Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0.5
Full stack trace of any exception that occurs:
java.lang.NoClassDefFoundError: /com/whatever/HibernateUtility
at dao.SessionDaoBlt.saveLcmSession(SessionDaoBlt.java:77)
at dao.SessionDaoTest.setUp(SessionDaoTest.java:38)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:436)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:311)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Name and version of the database you are using: Oracle 9.2
I am developing JUnit tests for classes that access Hibernate mappings and POJOS. I notice some very odd behaviors a couple of times. I use a class very much like the HibernateUtility class from Caveat Emptor for access to Session Factories, Sessions and Transactions. Another thing I should state is that these tests use the Schema Generation facility in the test setUp() method to create a fresh schema every time the test is run.
When certain changes are made to mapping files, which are not illegal (Hibernate maps them) I get NoClassDefFoundError as above.
Reverting the change out of the mapping allows the test to complete successfully (and it does access the HibernateUtility class at several points along the way).
I fail to understand how a mapping file change could cause the HibernateUtility class to not be found?