I get a java.lang.StackOverflowException during configuration while building the session factory, the stack is attached at the bottom of the message.
I saw this topic:
http://forum.hibernate.org/viewtopic.php?t=925978.
I'm fairly positive that only cglib2.jar is on the classpath.
I've tried setting the DriverManagerConnectionProvider instead of Proxool (wouldn't think was important since it's during session factory configuration, but I tried it anyway).
I saw this topic:
http://forum.hibernate.org/viewtopic.php?t=925208.
But my domain objects don't know anything about Hibernate (except in toString() to know not to touch anything on proxied classes/collections).
I can't tell what class it's working on when it barfs so I can't really tell you anything about the structure of the domain object it's having problems with.
Any thoughts on something else to try? I'm kind of stuck for a way forward from here.
Hibernate 2.1 final
JDK 1.4.2
Code:
13:51:49,719 main INFO SessionFactoryImpl:118 [testInteractionManipulations] building session factory
13:51:50,500 main ERROR LazyInitializer:83 [testInteractionManipulations] CGLIB Enhancement failed
net.sf.cglib.core.CodeGenerationException: java.lang.StackOverflowError-->null
at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:249)
at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:231)
at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:375)
at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:351)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:181)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:330)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:246)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:406)
at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:74)
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:801)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:741)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:41)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:136)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:726)
at nrm.clas.persistence.PersistenceServiceImpl.initSessionFactory(PersistenceServiceImpl.java:121)
at nrm.clas.persistence.PersistenceServiceImpl.init(PersistenceServiceImpl.java:74)
at nrm.clas.persistence.PersistenceComponentFactory.getPersistenceService(PersistenceComponentFactory.java:173)
at nrm.clas.common.persistence.PersistenceFactory.getPersistenceService(PersistenceFactory.java:51)
at nrm.clas.persistence.test.PersistenceTestCase.setupPersistenceService(PersistenceTestCase.java:56)
at nrm.clas.persistence.test.PersistenceTestCase.setUp(PersistenceTestCase.java:41)
at nrm.clas.persistence.elvas.interaction.test.InteractionPersistenceManagerTest.setUp(InteractionPersistenceManagerTest.java:40)
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 nrm.clas.test.ClasTestCase.run(ClasTestCase.java:508)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:325)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:524)
Caused by: java.lang.StackOverflowError
at java.lang.Exception.<init>(Exception.java:77)
at java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:54)
at nrm.clas.domain.reference.Reference$$FastClassByCGLIB$$5ff3e0cc.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:183)
at net.sf.hibernate.proxy.CGLIBLazyInitializer$1.intercept(CGLIBLazyInitializer.java:126)
at nrm.clas.domain.reference.StatusBatch$$EnhancerByCGLIB$$b20aece1.setActive(<generated>)
at nrm.clas.domain.reference.Reference$$FastClassByCGLIB$$5ff3e0cc.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:183)
at net.sf.hibernate.proxy.CGLIBLazyInitializer$1.intercept(CGLIBLazyInitializer.java:126)
at nrm.clas.domain.reference.StatusBatch$$EnhancerByCGLIB$$b20aece1.setActive(<generated>)
at nrm.clas.domain.reference.Reference$$FastClassByCGLIB$$5ff3e0cc.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:183)
...