-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: StackOverflowError during SessionFactory construction
PostPosted: Fri Dec 12, 2003 12:11 am 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
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)
...

_________________
Cheers,
Shorn.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 1:14 am 
Beginner
Beginner

Joined: Fri Aug 29, 2003 3:39 pm
Posts: 33
Location: San Francisco, CA
This looks like a bug in CGLIBLazyInitializer in 2.1 Final. I will submit a patch to Jira but it appears to be down right now.

The problem is probably that StatusBatch is proxies and you are calling setActive from within its constructor. This is causing the lazy initializer to go into an infinite loop. If you remove that call (for instance, by directly manipulating the field) it should go away.

Chris


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 1:29 am 
Beginner
Beginner

Joined: Fri Aug 29, 2003 3:39 pm
Posts: 33
Location: San Francisco, CA
Until Jira is back up you can get the patch here:
http://sixlegs.com/misc/stackoverflow.patch

Chris


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 1:15 pm 
Beginner
Beginner

Joined: Fri Aug 29, 2003 3:39 pm
Posts: 33
Location: San Francisco, CA
I've created a new issue: HB-546

Chris


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2003 7:04 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
Yep, that fixed it.

Soooo, I notice the build number I am now running is "2.1.1", so when's the expected official release date for that?

Sigh, I knew I should've run RC1 :)

_________________
Cheers,
Shorn.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.