i'm getting this EXACT same problem, only in the latest hibernate version. My junit test is failing (see stack trace below) if i run it from ant, but if i run the test from my IDE or if i uncheck the 'reload classes every run' in junit, it passes. clearly this is some kind of crazy classloader problem. I have the ehchache.jar file in my CP, and i have updated the excluded.properties file in my junit jar. anyone got any other ideas? this is killing me since i know the test passes!
[junit] net.sf.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.ehcache.hibernate.Provider
[junit] at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:133)
[junit] at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
[junit] at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
[junit] at store.HibernateProfileStore.initConfig(HibernateProfileStore.java:38)
[junit] at store.HibernateProfileStore.saveProfile(HibernateProfileStore.java:163)
[junit] at store.test.HibernateProfileStoreTest.testGetAndSave(HibernateProfileStoreTest.java:40)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:324)
[junit] at junit.framework.TestCase.runTest(TestCase.java:154)
[junit] at junit.framework.TestCase.runBare(TestCase.java:127)
[junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
[junit] at junit.framework.TestResult.runProtected(TestResult.java:124)
[junit] at junit.framework.TestResult.run(TestResult.java:109)
[junit] at junit.framework.TestCase.run(TestCase.java:118)
[junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] at junit.swingui.TestRunner$16.run(TestRunner.java:623)
[junit] Caused by: java.lang.ClassCastException
[junit] java.lang.NullPointerException
[junit] at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:130)
[junit] ... 18 more
[junit] at store.HibernateProfileStore.saveProfile(HibernateProfileStore.java:186)
[junit] at store.test.HibernateProfileStoreTest.testGetAndSave(HibernateProfileStoreTest.java:40)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:324)
[junit] at junit.framework.TestCase.runTest(TestCase.java:154)
[junit] at junit.framework.TestCase.runBare(TestCase.java:127)
[junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
[junit] at junit.framework.TestResult.runProtected(TestResult.java:124)
[junit] at junit.framework.TestResult.run(TestResult.java:109)
[junit] at junit.framework.TestCase.run(TestCase.java:118)
[junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] at junit.swingui.TestRunner$16.run(TestRunner.java:623)
[junit] Jun 20, 2004 10:22:19 PM net.sf.hibernate.connection.DriverManagerConnectionProvider close
[junit] INFO: cleaning up connection pool: jdbc:oracle:thin:@localhost:1521:test
|