-->
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: Cglib, ASM & Hibernate 3.2.5 Issue and Resolution...
PostPosted: Fri Oct 26, 2007 11:32 am 
Newbie

Joined: Fri Oct 26, 2007 11:21 am
Posts: 1
Location: Woking
Hello All,

We are using Hibernate 3.2.5 on Websphere Application Server 6.x.

We were getting a weird error with the CGLib & ASM libraries. We were using the libraries that are shipped with hibernate-3.2.5.ga.zip. With no-doubt they should have worked fine on the app server, but it didn't. We were getting the following error:
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(ILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:63)
at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:173)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215)
at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
at net.sf.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:236)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:791)
and so on..............

After lots of fighting, we found the following resolution to the problem.
The resolution is to have cglib-nodep-2.1_3.jar in the classpath and delete the cglib-2.1.3.jar and asm.jar.

cglib-nodep-2.1_3.jar includes the asm classes in the same jar. We didn't get the exact reason for this error, but the solution is working and though of sharing with others as it could help save some time.

Let me know if you have any questions.

Regards
Hemanth


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 11, 2008 8:30 am 
Beginner
Beginner

Joined: Sat Aug 30, 2003 1:36 am
Posts: 47
Location: Calgary, AB
Thanks for this post, saved me a ton of time! Why doesn't hibernate just ship with this jar by default? This seems to cause problems with Spring 2, JAX-RS, etc. (basically anything that needs asm 2+).


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.