tags:

views:

26

answers:

1

Hi!

I made a java application using the hibernate framework, with the xml files of hibernate in the src folder. Now, I moved the files in config folder from my project, I changed the SessionFactoryUtil members to:

private static File f = new File("config/hibernate.cfg.xml");
private static SessionFactory sessionFactory = new Configuration().configure(f).buildSessionFactory();

And in the hibernate.cfg.xml I changed themappin resource to config/entities.hbm.xml

And now I have an exception:

org.hibernate.MappingNotFoundException: resource: config/entities.hbm.xml not found

Do you know a workaround?

+2  A: 

This really depends on how your build is done. Most of the time it's you IDE which defines how your build is done.

If you use maven to build you can put the configuration in the folder named resources. If you use an IDE, you should try to find how your "config" folder can be added to the build path.

Colin Hebert
Thanks, now it's done. I put the config folder to the build path.
DaJackal