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
|