lundi 1 février 2010
Hibernate: NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit [...]
Par Pierre, lundi 1 février 2010 à 13:17 :: Java Core & Java EE
If you try to deploy a Java WebApp (that use hibernate 3.2.2 as ORM) within the standard RAD integrated test environment (IBM WebSphere 6.1), you may experience the exception below :
[01/02/10 13:09:59:572 CET] 00000024 SystemErr R Caused by: java.lang.NoSuchMethodError:
org/objectweb/asm/ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)
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:216)
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.cglib.proxy.Enhancer.
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:192)
The (probably not only one) solution is to replace both libraries ASM (Java bytecode manipulation and analysis framework, in my case asm-1.5.3.jar) and CGLIB (Code Generation Library, in my case cglib-2.1.3.jar) with a standalone package of CGLIB, which does not require dependencies with ASM. This package is downloadble from the CGLIB repository as cglib-nodep-2.1_3.jar.
