|Eclipse application using Hibernate [message #75085]
||Wed, 19 December 2007 04:33
Registered: July 2009
There are 2 different projects in my workspace. Project A and
A is dependent on B. A has a java class X(say) that uses hibernate to
fetch data from database.
.hbm.xml files and corresponding classes needed for the same are
in project B and under same package. When i run class X individually
(using public static void main...), it works fine. But when i try to run
the project as eclipse application, it doesnt find hibernate.cfg.xml. If i
hardcode the file path(which is not right way of doing it) in my class
while calling .configuer(path), it gets the file but doesnt find any
class which is mentioned in .hbm.xml file.
My hibernate.cfg.xml is in project B. Even if i place it in
project A it gives same problem. I tried placing it under root dir/ in
src, in both the projects but faced same problem.
I tried adding all the properties and classes through code using
configure.addClass(..) and configure.setProperty(..). Still it didnt work.
Can anybody help?
Powered by FUDForum
. Page generated in 0.01741 seconds