-->
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.  [ 29 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: 2.1 final: CGLIB enhancement failed
PostPosted: Thu Dec 11, 2003 11:55 am 
Beginner
Beginner

Joined: Wed Oct 01, 2003 3:47 pm
Posts: 44
Hello, I just upgraded to 2.1 final from 2.1 beta 4. I also upgraded all supporting jars including cglib2.

I'm now receiving the following error which did not appear under beta 4. No other changes to the code have been made.

Any ideas? I don't even know where to start looking.

Thanks.

-------

SEVERE: CGLIB Enhancement failed
net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:192)
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 com.thoughtatlas.DataStore.inititalizeDataStore(Unknown Source)
at com.thoughtatlas.Environment.<clinit>(Unknown Source)
at com.thoughtatlas.webapp.ActionServlet.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1002)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:712)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:186)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:578)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:209)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:670)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:517)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:575)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.reflect.InvocationTargetException
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.core.ReflectUtils.defineClass(ReflectUtils.java:373)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:181)
... 44 more
Caused by: java.lang.ClassFormatError: Illegal Field name "CGLIB$load_class$ARRAY0$_Ljava_lang_String;"
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.lang.ClassLoader.defineClass(ClassLoader.java:382)
... 50 more


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 11, 2003 12:08 pm 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
Make sure there is no jars from old CGLIB in your classpath.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 11, 2003 12:15 pm 
Beginner
Beginner

Joined: Wed Oct 01, 2003 3:47 pm
Posts: 44
Hi Dimas,

Thanks for the reply. To be clear, this error does occur when only cglib2.jar is in the classpath.

Ryan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 11, 2003 12:48 pm 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
Take a look at http://www.hibernate.org/74.html#A2

I don't think there is a solution for your problem - just a bit more information. (One of ideas from the link above is to rebuild CGLIB2 from CVS. Probably this issue is already fixed)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 11, 2003 2:42 pm 
Beginner
Beginner

Joined: Fri Aug 29, 2003 3:39 pm
Posts: 33
Location: San Francisco, CA
It appears the bug fix in RC1 was not totally successful :-(
It is being investigated and I'll post more later...


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

Joined: Fri Aug 29, 2003 3:39 pm
Posts: 33
Location: San Francisco, CA
The bug has been fixed and is available in CGLIB CVS.
If you have experienced this bug in Hibernate 2.1 Final and urgently need a fix let me know.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 8:32 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
CAn you add this in the FAQ from the forum, please

_________________
Emmanuel


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

Joined: Fri Aug 29, 2003 3:39 pm
Posts: 33
Location: San Francisco, CA
Done.


Top
 Profile  
 
 Post subject: PropertyAccessException
PostPosted: Wed Jan 21, 2004 8:30 am 
Newbie

Joined: Wed Jan 21, 2004 8:23 am
Posts: 18
herbyderby wrote:
The bug has been fixed and is available in CGLIB CVS.
If you have experienced this bug in Hibernate 2.1 Final and urgently need a fix let me know.


I am runnig Hibernate 2.11, and have what looks like it is the same problem:

13:29:25,526 ERROR [STDERR] net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of no.cronus.forit.hibernate.Article.setTypeNo
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:216)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2137)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:239)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:109)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3440)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:177)
at no.cronus.forit.struts.action.TestAction.execute(TestAction.java:67)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)
Caused by: net.sf.cglib.beans.BulkBeanException
at no.cronus.forit.hibernate.Article$$BulkBeanByCGLIB$$c13bff5a.setPropertyValues(<generated>)
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:211)
... 53 more
Caused by: java.lang.NullPointerException
... 55 more


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 21, 2004 9:00 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Make sure there is no jars from old CGLIB in your classpath.


Top
 Profile  
 
 Post subject: PropertyAccessException / classpath / cglib2
PostPosted: Wed Jan 21, 2004 9:24 am 
Newbie

Joined: Wed Jan 21, 2004 8:23 am
Posts: 18
gloeglm wrote:
Make sure there is no jars from old CGLIB in your classpath.


How can I find out what to look for in my classpath?
- I have cglib2.jar in jboss-3.2.3\server\default\lib
- No other cg*.jar files exist in my classpath


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 21, 2004 10:01 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Try to set hibernate.cglib.use_reflection_optimizer=false as said in the Exception.
Does it fail ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: PropertyAccessException
PostPosted: Wed Jan 21, 2004 10:11 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
knuterik wrote:
13:29:25,526 ERROR [STDERR] net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of no.cronus.forit.hibernate.Article.setTypeNo
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:216)


It is nothing wrong in cglib at this time, it is a problem with null value for primitive type.


Top
 Profile  
 
 Post subject: PropertyAccessException / classpath / cglib2
PostPosted: Wed Jan 21, 2004 10:11 am 
Newbie

Joined: Wed Jan 21, 2004 8:23 am
Posts: 18
gloeglm wrote:
Make sure there is no jars from old CGLIB in your classpath.


How can I find out what to look for in my classpath?
- I have cglib2.jar in jboss-3.2.3\server\default\lib
- No other cg*.jar files exist in my classpath


Top
 Profile  
 
 Post subject: Re: PropertyAccessException
PostPosted: Wed Jan 21, 2004 10:40 am 
Newbie

Joined: Wed Jan 21, 2004 8:23 am
Posts: 18
baliukas wrote:
knuterik wrote:
13:29:25,526 ERROR [STDERR] net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of no.cronus.forit.hibernate.Article.setTypeNo
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:216)


It is nothing wrong in cglib at this time, it is a problem with null value for primitive type.


I set hibernate.cglib.use_reflection_optimizer=false as said in the Exception.
Then I get this error:

15:32:48,000 ERROR [STDERR] net.sf.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of no.cronus.forit.hibernate.Article.typeNo
at net.sf.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:225)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2137)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:239)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:109)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3440)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:177)

So it seems like you are right in that regards,
except that all previous log statements indicate that the value set is '1', and not 'null':

15:36:18,155 DEBUG [SQL] select articletyp0_.ArticleType as ArticleT1_0_, articletyp0_.ArticleTypeName as ArticleT2_0_ from ArticleTypes articletyp0_ where articletyp0_.ArticleType=?
15:36:18,155 DEBUG [BatcherImpl] preparing statement
15:36:18,155 DEBUG [ShortType] binding '1' to parameter: 1
15:36:18,175 DEBUG [Loader] processing result set
15:36:18,175 DEBUG [Loader] result row: 1
15:36:18,175 DEBUG [Loader] Initializing object from ResultSet: 1
15:36:18,175 DEBUG [Loader] Hydrating entity: no.cronus.forit.hibernate.ArticleType#1
15:36:18,185 DEBUG [StringType] returning 'R


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 29 posts ]  Go to page 1, 2  Next

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.