[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology] Eclipse application using Hibernate

Hi all,

There are 2 different projects in my workspace. Project A and B(say).
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?