This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am currently stuck at my project with a strange java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration exception.
I get this exception at the line: SessionFactory sessionFactory = new Configuration().configure("xml\\hibernate.cfg.xml").buildSessionFactory();
And yes, i have the hibernate jars in lib folder and have included them in java build path.
The code and configuration doesnt seem to have a problem as they work fine in an independent java project whereas throws this exception when executed from an EJB project jar.
Is it a class loading conflict between EJB project jars and JBOSS AS7 persistance jars which are in modules folder of Jboss?
Any help would be much appreciated!!!
More details below:
I am using Eclipse, JBoss AS7.0.2 Final & hibernate 3
My project structure is as below:
-----------resources (some xsd files)
-----------xml (hibernate config files)
All jars in lib folder are getting included in the EJB jar when deploying and are getting extracted in the Jboss/standalone/deployments folder.
I have the following jars in the project lib folder