-->
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.  [ 3 posts ] 
Author Message
 Post subject: OutOfMemoryError with Hibernate 3
PostPosted: Mon Jun 06, 2005 10:56 am 
Regular
Regular

Joined: Thu Sep 04, 2003 10:43 am
Posts: 61
I have e 3 tier application, (client-app-server-db, no web-server is used) with many mapped class (at now they are 254) and it works perfectly with Hibernate 2.1.6.

Now we're trying to migrate to Hibernate3 (and it's related lib), but I have an out of memory exception while Hibernare is creating the sessionFactory.

This is a part of the stack-trace:

16:42:47,734 ERROR [BasicLazyInitializer] CGLIB Enhancement failed: [myClassName]
java.lang.ExceptionInInitializerError
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at net.sf.cglib.proxy.Enhancer.setCallbacksHelper(Enhancer.java:586)
at net.sf.cglib.proxy.Enhancer.setThreadCallbacks(Enhancer.java:579)
at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:601)
at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:532)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:220)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640)
at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94)
at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42)
at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144)
at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83)
at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218)
at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
...
[omissis]
...
Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:236)
at net.sf.cglib.reflect.FastClass$Generator.create(FastClass.java:67)
at net.sf.cglib.proxy.MethodProxy.helper(MethodProxy.java:81)
at net.sf.cglib.proxy.MethodProxy.create(MethodProxy.java:47)
at [myClassName]$$EnhancerByCGLIB$$5a2d02e0.CGLIB$STATICHOOK195(<generated>)
at [myClassName]$$EnhancerByCGLIB$$5a2d02e0.<clinit>(<generated>)
... 87 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:373)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:218)
... 92 more
Caused by: java.lang.OutOfMemoryError

Note that everytime [myClassName] changes, so it's not here the problem.

This occurs both with Orion 9.5.1 and JBoss 3.2.5.

I've try to change the hibernate.cache.provider_class value (which now is org.hibernate.cache.TreeCacheProvider), but the error is always an OutOfMemoryError.
I've also try to increase the memory for the app-server with -Xms128m -Xmx1024m parameters for the app-server, but nothing changes.

Any ideas or suggestions?
Regards
Alessandro Rizzi


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 11:05 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
"Lazy" is default in hibernate3 and probably CGLIB will generate more stuff, it needs permatent memory:

http://forum.hibernate.org/viewtopic.php?t=943395


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 11:11 am 
Regular
Regular

Joined: Thu Sep 04, 2003 10:43 am
Posts: 61
baliukas wrote:
"Lazy" is default in hibernate3 and probably CGLIB will generate more stuff, it needs permatent memory:

http://forum.hibernate.org/viewtopic.php?t=943395


GREAT! Now it works again.

many, many, many thanks
Alessandro


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.