-->
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: Invalid method Code length
PostPosted: Thu Aug 04, 2005 12:04 am 
Regular
Regular

Joined: Thu Sep 23, 2004 11:53 am
Posts: 83
Exception is thrown while Hibernate loads configuration files, I used Hibernate Tools Alpha 4 to generate the xml mapping files, if that helps any. Don't know what caused the exception to be thrown, seems like maybe there is a an extremely long method in the class, but I looke at the class definition and nothing seemd longer then about 20 characters or so. Any ideas?

Hibernate version:
3.1 (latest)
Mapping documents:
There are 1300 of them let me which one you need
Code between sessionFactory.openSession() and session.close():
Code:
      Configuration cfg = new Configuration();
      cfg.configure("/hibernate.cfg.xml");
      SessionFactory sessionFactory = cfg.buildSessionFactory();
      Session session = sessionFactory.openSession();
      session.close();

Full stack trace of any exception that occurs:
Code:
net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
   at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:236)
   at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
   at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
   at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:100)
   at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:41)
   at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:158)
   at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:88)
   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:245)
   at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:402)
   at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
   at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
   at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:213)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:981)
   at com.Main.main(Main.java:12)
Caused by: java.lang.reflect.InvocationTargetException
   at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
   at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:218)
   ... 15 more
Caused by: java.lang.ClassFormatError: Invalid method Code length 107893 in class file com/RPpdmRowQuality$$EnhancerByCGLIB$$24bf1b20
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
   ... 20 more
22:51:25,640  WARN PojoTuplizer:170 - could not create proxy factory for:com.RPpdmRowQuality
org.hibernate.HibernateException: CGLIB Enhancement failed: com.RPpdmRowQuality
   at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:106)
   at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:41)
   at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:158)
   at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:88)
   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:245)
   at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:402)
   at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
   at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
   at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:213)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:981)
   at com.Main.main(Main.java:12)
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.proxy.Enhancer.createHelper(Enhancer.java:377)
   at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
   at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:100)
   ... 12 more
Caused by: java.lang.reflect.InvocationTargetException
   at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
   at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:218)
   ... 15 more
Caused by: java.lang.ClassFormatError: Invalid method Code length 107893 in class file com/RPpdmRowQuality$$EnhancerByCGLIB$$24bf1b20
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
   ... 20 more

Name and version of the database you are using:
Oracle 10g
The generated SQL (show_sql=true):
NA
Debug level Hibernate log excerpt:
before exception
Code:

22:51:16,000 DEBUG BasicEntityPersister:2225 - Static SQL for entity: com.LEntComponent
22:51:16,000 DEBUG BasicEntityPersister:2227 -  Version select: select ENTITLEMENT_ID, COMPONENT_ID, AREA_ID, AREA_TYPE, BUSINESS_ASSOCIATE, CONTRACT_ID, DATA_SOURCE, DESCRIPTION, ENT_COMP_TYPE, ENT_RULE, FACILITY_ID, FACILITY_TYPE, FIELD_ID, INFORMATION_ITEM_ID, INFO_ITEM_TYPE, INTEREST_SET_ID, LAND_RIGHT_ID, LAND_RIGHT_TYPE, PDEN_ID, PDEN_SOURCE, PDEN_TYPE, RESENT_ID, PPDM_GUID, SEIS_SET_ID, SEIS_SET_TYPE, UWI from PPDM37.L_ENT_COMPONENT where ENTITLEMENT_ID =? and COMPONENT_ID =? and AREA_ID =? and AREA_TYPE =? and BUSINESS_ASSOCIATE =? and CONTRACT_ID =? and DATA_SOURCE =? and DESCRIPTION =? and ENT_COMP_TYPE =? and ENT_RULE =? and FACILITY_ID =? and FACILITY_TYPE =? and FIELD_ID =? and INFORMATION_ITEM_ID =? and INFO_ITEM_TYPE =? and INTEREST_SET_ID =? and LAND_RIGHT_ID =? and LAND_RIGHT_TYPE =? and PDEN_ID =? and PDEN_SOURCE =? and PDEN_TYPE =? and RESENT_ID =? and PPDM_GUID =? and SEIS_SET_ID =? and SEIS_SET_TYPE =? and UWI =?
22:51:16,000 DEBUG BasicEntityPersister:2228 -  Snapshot select: select lentcompon_.ENTITLEMENT_ID, lentcompon_.COMPONENT_ID, lentcompon_.AREA_ID, lentcompon_.AREA_TYPE, lentcompon_.BUSINESS_ASSOCIATE, lentcompon_.CONTRACT_ID, lentcompon_.DATA_SOURCE, lentcompon_.DESCRIPTION, lentcompon_.ENT_COMP_TYPE, lentcompon_.ENT_RULE, lentcompon_.FACILITY_ID, lentcompon_.FACILITY_TYPE, lentcompon_.FIELD_ID, lentcompon_.INFORMATION_ITEM_ID, lentcompon_.INFO_ITEM_TYPE, lentcompon_.INTEREST_SET_ID, lentcompon_.LAND_RIGHT_ID, lentcompon_.LAND_RIGHT_TYPE, lentcompon_.PDEN_ID, lentcompon_.PDEN_SOURCE, lentcompon_.PDEN_TYPE, lentcompon_.RESENT_ID, lentcompon_.PPDM_GUID, lentcompon_.SEIS_SET_ID, lentcompon_.SEIS_SET_TYPE, lentcompon_.UWI from PPDM37.L_ENT_COMPONENT lentcompon_ where lentcompon_.ENTITLEMENT_ID=? and lentcompon_.COMPONENT_ID=? and lentcompon_.AREA_ID=? and lentcompon_.AREA_TYPE=? and lentcompon_.BUSINESS_ASSOCIATE=? and lentcompon_.CONTRACT_ID=? and lentcompon_.DATA_SOURCE=? and lentcompon_.DESCRIPTION=? and lentcompon_.ENT_COMP_TYPE=? and lentcompon_.ENT_RULE=? and lentcompon_.FACILITY_ID=? and lentcompon_.FACILITY_TYPE=? and lentcompon_.FIELD_ID=? and lentcompon_.INFORMATION_ITEM_ID=? and lentcompon_.INFO_ITEM_TYPE=? and lentcompon_.INTEREST_SET_ID=? and lentcompon_.LAND_RIGHT_ID=? and lentcompon_.LAND_RIGHT_TYPE=? and lentcompon_.PDEN_ID=? and lentcompon_.PDEN_SOURCE=? and lentcompon_.PDEN_TYPE=? and lentcompon_.RESENT_ID=? and lentcompon_.PPDM_GUID=? and lentcompon_.SEIS_SET_ID=? and lentcompon_.SEIS_SET_TYPE=? and lentcompon_.UWI=?
22:51:16,000 DEBUG BasicEntityPersister:2230 -  Insert 0: insert into PPDM37.L_ENT_COMPONENT (ENTITLEMENT_ID, COMPONENT_ID, AREA_ID, AREA_TYPE, BUSINESS_ASSOCIATE, CONTRACT_ID, DATA_SOURCE, DESCRIPTION, ENT_COMP_TYPE, ENT_RULE, FACILITY_ID, FACILITY_TYPE, FIELD_ID, INFORMATION_ITEM_ID, INFO_ITEM_TYPE, INTEREST_SET_ID, LAND_RIGHT_ID, LAND_RIGHT_TYPE, PDEN_ID, PDEN_SOURCE, PDEN_TYPE, RESENT_ID, PPDM_GUID, SEIS_SET_ID, SEIS_SET_TYPE, UWI) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
22:51:16,000 DEBUG BasicEntityPersister:2231 -  Update 0: null
22:51:16,000 DEBUG BasicEntityPersister:2232 -  Delete 0: delete from PPDM37.L_ENT_COMPONENT where ENTITLEMENT_ID=? and COMPONENT_ID=? and AREA_ID=? and AREA_TYPE=? and BUSINESS_ASSOCIATE=? and CONTRACT_ID=? and DATA_SOURCE=? and DESCRIPTION=? and ENT_COMP_TYPE=? and ENT_RULE=? and FACILITY_ID=? and FACILITY_TYPE=? and FIELD_ID=? and INFORMATION_ITEM_ID=? and INFO_ITEM_TYPE=? and INTEREST_SET_ID=? and LAND_RIGHT_ID=? and LAND_RIGHT_TYPE=? and PDEN_ID=? and PDEN_SOURCE=? and PDEN_TYPE=? and RESENT_ID=? and PPDM_GUID=? and SEIS_SET_ID=? and SEIS_SET_TYPE=? and UWI=?
22:51:25,625 ERROR BasicLazyInitializer:104 - CGLIB Enhancement failed: com.RPpdmRowQuality


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 9:10 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
set system property "cglib.debugLocation" to dump byte code to specified directory (you see wrong class in stack trace). Add stuff hibernate jira or send it to cglib list, method body is too large in this case (probably it is a static initializer if you have deep class herachy and many declared methods)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 06, 2005 2:55 pm 
Regular
Regular

Joined: Thu Sep 23, 2004 11:53 am
Posts: 83
I set the cglib.debugLocation system variable and it dump all 1300+ class files to the directory. Should I post the stack trace and cglib output to the Jira?

Thanks
J


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 06, 2005 3:01 pm 
Regular
Regular

Joined: Thu Sep 23, 2004 11:53 am
Posts: 83
The hibernate loading process still keeps running even though I recieve several of these exceptions. Does this mean that hibernate will still run properly?

Also, I ran out of memory while the cglib was running, seems that it runs in its own jvm?. How do I increase the max allowable memory for cglib, or am I way off base. Note that eclipse is setup for max memory of 1.6GB, which was needed because the reverse engineering took about that much to run to completion.

Thanks for any help
J


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 06, 2005 3:04 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
For debugging purposes it's probably a good idea not to use 1300 entities. Can you isolate this by generating/working with only a subset?


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.