-->
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.  [ 2 posts ] 
Author Message
 Post subject: hibernate3 cglib enhancement failure
PostPosted: Wed May 18, 2005 5:31 pm 
Newbie

Joined: Wed May 18, 2005 4:34 pm
Posts: 2
I have an spring+hibernate3 application that uses two databases: postgresql and M$ sqlserver. When the application initializes the SQL Server sessionFactory, I see the following CGLIB exception:

4110 [main] ERROR proxy.BasicLazyInitializer - CGLIB Enhancement failed: com.triage.model.domain.lims.Test
java.lang.IllegalArgumentException: class com.triage.model.domain.lims.Test$$EnhancerByCGLIB$$cd3e1044 is not an enhanced class

at net.sf.cglib.proxy.Enhancer.setCallbacksHelper(Enhancer.java:588)
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:217)
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:210)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:758)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:685)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:937)
...
4125 [main] WARN tuple.PojoTuplizer - could not create proxy factory for:com.triage.model.domain.lims.Test
org.hibernate.HibernateException: CGLIB Enhancement failed: com.triage.model.domain.lims.Test

at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:108)
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:217)
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:210)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:758)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:685)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:937)
at
...

I've made sure that I'm using the latest cglib (2.1) and that there is only one cglib in my classpath. I also tried setting 'hibernate.cglib.use_reflection_optimizer=false' but nothing changed.

I'm using the latest hibernate version (3.0.3)...any ideas?

*I can post the hibernate mapping file for the Test class and/or the full exception trace if it will help


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 18, 2005 6:20 pm 
Newbie

Joined: Wed May 18, 2005 4:34 pm
Posts: 2
nevermind I found it :)

My ant task was excluding the classes that CGLIB could not enhance...


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