-->
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.  [ 1 post ] 
Author Message
 Post subject: CGLIB Enhancement failed HELP!!
PostPosted: Fri Feb 22, 2008 11:25 am 
Newbie

Joined: Mon Jul 23, 2007 11:58 am
Posts: 15
Location: New Jersey
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3

Guys/Gals,

I am pulling my hair out on this one!! I am using Spring2.x/Hibernate 3 in my project. I have been testing locally on myeclipse ide without a hitch. I have been using the myeclipse libraries for spring and hibernate (the ones that come bundled with myeclipse). Everything has been working fine in my ide, my app runs great. Then I decided to run a build, and test it on unix. This is where my problems began. I created a simple ant script that will build a jar that contains all the libraries. Below is a list of the jars that are on my classpath taken from my manifest:

Class-Path: classes/ JEFCO_COMMONS.jar antlr-2.7.6rc1.jar aopalliance.
jar asm-2.2.3.jar asm-attrs.jar asm-commons-2.2.3.jar asm-util-2.2.3.
jar aspectjrt.jar aspectjweaver.jar c3p0-0.9.1.1.jar cglib-2.1.3.jar
com.ibm.mq.jar com.ibm.mq.pcf-6.0.3.jar com.ibm.mqjms.jar commons-att
ributes-api.jar commons-attributes-compiler.jar commons-beanutils-1.6
.jar commons-beanutils.jar commons-collections-2.1.1.jar commons-coll
ections-2.1.jar commons-collections.jar commons-dbcp-1.2.2.jar common
s-dbcp.jar commons-digester-1.5.jar commons-digester.jar commons-file
upload-1.2.jar commons-lang.jar commons-logging-1.0.4.jar commons-log
ging.jar commons-pool-1.3.jar connector.jar dom4j-1.6.1.jar ehcache-1
.1.jar el-api-1.0.jar el-impl-1.0.jar hibernate-annotations.jar hiber
nate-commons-annotations.jar hibernate-entitymanager.jar hibernate3.j
ar ibatis-2.3.0.677.jar j4j.jar jaas.jar jakarta-oro-2.0.8.jar jaxen-
1.1-beta-7.jar jboss-archive-browsing.jar jconn3.jar jdbc2_0-stdext.j
ar jdo2-api.jar jefcocommons.jar jms.jar jotm.jar jsf-api-1.1_02.jar
jsf-api.jar jsf-facelets-1.1.12.jar jsf-impl-1.1_02.jar jsf-impl.jar
jstl-1.0.jar jstl.jar jta.jar log4j-1.2.13.jar log4j-1.2.14.jar mqcon
text.jar openjpa-0.9.7-incubating.jar oscache-2.3.jar persistence.jar
phaseTracker.jar richfaces-api-3.1.2.SP1.jar richfaces-impl-3.1.2.SP
1.jar richfaces-ui-3.1.2.SP1.jar serp-1.12.1.jar spring-agent.jar spr
ing-aop.jar spring-beans.jar spring-context.jar spring-core.jar sprin
g-dao.jar spring-hibernate3.jar spring-ibatis.jar spring-jdbc.jar spr
ing-jdo.jar spring-jpa.jar spring-tomcat-weaver.jar spring-toplink.ja
r spring.jar sqljdbc.jar standard.jar tomahawk-1.1.6.jar toplink-api.
jar toplink-essentials.jar xapool.jar xerces-2.6.2.jar xml-apis.jar

I keep getting a CGLib NoClassDefFoundError, when hibernate tries to extend my classes. These classes are definitely in the classpath, so I think the error is misleading. I have been googling around for a solution, and I have noticed one common theme: All the problems seem to be related to conflicts of jars in the classpath. I have tried all different combinations - I removed cglib2.3 and replaced it with cglib with dependencie - I have tried both. But the error remains. I have taken out asm.jar from the classpath but the error remains! Please, I am supposed to go out to qa with this one tomorrow. HELP!!

-Roy




22-Feb-2008 10:08:49 [ERROR] BasicLazyInitializer.[getProxyFactory] ***

[CGLIB Enhancement failed: com.jefco.jpm.domain.TOptionData]
java.lang.NoClassDefFoundError
at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:116)
at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:41)
at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:161)
at org.hibernate.tuple.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:131)
at org.hibernate.tuple.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:257)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
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:215)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1154)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:728)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:668)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1175)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:407)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:255)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:252)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:689)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:358)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
at com.jefco.jpm.batch.launcher.BatchLauncher.main(Unknown Source)
22-Feb-2008 10:08:49 [WARN ] PojoEntityTuplizer.[buildProxyFactory] *** [could not create proxy factory for:com.jefco.jpm.domain.TOptionData]
org.hibernate.HibernateException: CGLIB Enhancement failed: com.jefco.jpm.domain.TOptionData
at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:132)
at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:41)
at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:161)
at org.hibernate.tuple.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:131)
at org.hibernate.tuple.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java
Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

Code:
Code:
Code:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.