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.  [ 4 posts ] 
Author Message
 Post subject: lazy + class is not enhanced cglib exception
PostPosted: Tue Oct 09, 2007 5:22 am 
Newbie

Joined: Mon Oct 08, 2007 11:18 pm
Posts: 3
Dear all,

I keep getting this error when enabling lazy loading.

I'm using hibernate 3.2.0ga deployed under jboss-4.0.5ga.

edit: oh yes, did i mention that i didnt set any setting such as lazy="true|false|no-proxy|proxy" in the mapping file. Since i'm using hibernate 3.2.0 it should default to proxy.

Code:
Caused by: org.hibernate.HibernateException: CGLIB Enhancement failed: com.bizi.model.Priority
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:102)
   at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.getProxy(CGLIBProxyFactory.java:49)
   at org.hibernate.tuple.entity.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:379)
   at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3388)
   at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:255)
   at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:189)
   at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101)
   at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
   at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846)
   at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
   at org.hibernate.type.EntityType.resolve(EntityType.java:303)
   at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116)
   at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
   at org.hibernate.loader.Loader.doQuery(Loader.java:717)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
   at org.hibernate.loader.Loader.doList(Loader.java:2144)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
   at org.hibernate.loader.Loader.list(Loader.java:2023)
   at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
   at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
   at com.bizi.common.dao.impl.HibernateDAOImpl.find(HibernateDAOImpl.java:104)
   ... 79 more
Caused by: java.lang.IllegalArgumentException: class com.bizi.model.Priority$$EnhancerByCGLIB$$95d1c2a4 is not an enhanced class
   at net.sf.cglib.proxy.Enhancer.setCallbacksHelper(Enhancer.java:618)
   at net.sf.cglib.proxy.Enhancer.setThreadCallbacks(Enhancer.java:609)
   at net.sf.cglib.proxy.Enhancer.registerCallbacks(Enhancer.java:578)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:98)
   ... 100 more



I tried setting hibernate.bytecode.use_reflection_optimizer to true and false but that doesn't change the situation.

My classes were not compiled using buildtime bytecode instrumentation.

This happened in the dao layer so i don't think it is an Session/Transaction issue. But i'm not sure could caused that.

Please shed some light.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 12, 2007 4:20 am 
Newbie

Joined: Mon Oct 08, 2007 11:18 pm
Posts: 3
Hi guys, still couldn't solve this myself, anyone willing to help?


Top
 Profile  
 
 Post subject: we have the same problem
PostPosted: Wed Oct 15, 2008 7:43 am 
Newbie

Joined: Wed Oct 15, 2008 7:38 am
Posts: 2
hey we have the same problem.
we run our application on 2 different development machines
and my friend has the same problem with you however i do not face with this problem.

We could not find the root cause. Have you solved the problem?

thanks.


Top
 Profile  
 
 Post subject: solved
PostPosted: Wed Oct 15, 2008 10:42 am 
Newbie

Joined: Wed Oct 15, 2008 7:38 am
Posts: 2
ok we solved it thanks.
it was because cglib jar's classpath order.


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