You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Mathias P.W Nilsson" <ma...@snyltarna.se> on 2007/08/16 16:59:16 UTC

Hibernate and resources

Ahhh.... I'm tearing hair out. I've set up maven, mysql, c3p0 and hibernate. 
Actually I want to use spring but I don't know how. Anyway when I test the
application the testcase can't find hibernate.cfg.xml?

I've read that all files,images should be in the src/main/java/resources.
But for me to get it to work I have to put the hibernate.cfg.xml in
src/main/java. 

Can anyone help me with this?
-- 
View this message in context: http://www.nabble.com/Hibernate-and-resources-tf4280221s177.html#a12183032
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Hibernate and resources

Posted by Johann Reyes <an...@gmail.com>.
Hello Mathias

you should put it in your resources directory and do something like this in
your applicationContext.xml in your sessionFactory bean:

<property name="configLocation" value="classpath:hibernate.cfg.xml"/>

Regards

Johann Reyes

Re: Hibernate and resources

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
Yes! I did that and it worked! Thanks :)
-- 
View this message in context: http://www.nabble.com/Hibernate-and-resources-tf4280221s177.html#a12183535
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Hibernate and resources

Posted by Wayne Fay <wa...@gmail.com>.
Not s/m/j/resources, simply src/main/resources. Try that and see if it works.

And if this is simply for testing, put your file in src/test/resources.

Wayne

On 8/16/07, Mathias P.W Nilsson <ma...@snyltarna.se> wrote:
>
> Ahhh.... I'm tearing hair out. I've set up maven, mysql, c3p0 and hibernate.
> Actually I want to use spring but I don't know how. Anyway when I test the
> application the testcase can't find hibernate.cfg.xml?
>
> I've read that all files,images should be in the src/main/java/resources.
> But for me to get it to work I have to put the hibernate.cfg.xml in
> src/main/java.
>
> Can anyone help me with this?
> --
> View this message in context: http://www.nabble.com/Hibernate-and-resources-tf4280221s177.html#a12183032
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org