Details
-
Type: Bug
-
Status: Closed
-
Priority: Minor
-
Resolution: Not A Bug
-
Affects Version/s: None
-
Fix Version/s: 1.x Maintenance
-
Component/s: None
-
Labels:None
-
JDK version and platform:Sun jdk1.6.0_06 for Windows
Description
My maven project requires asm version 3.1 because of Jersey rest implementation.
Marshalling of ArrayList fails with exception:
java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
at net.sf.cglib.core.DebuggingClassWriter.<init>(DebuggingClassWriter.java:47)
at net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorStrategy.java:30)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:24)
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.<clinit>(Enhancer.java:69)
at com.thoughtworks.xstream.converters.reflection.CGLIBEnhancedConverter.canConvert(CGLIBEnhancedConverter.java:67)
at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:60)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:68)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:98)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:38)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:845)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:834)
at com.thoughtworks.xstream.XStream.toXML(XStream.java:815)
at com.thoughtworks.xstream.XStream.toXML(XStream.java:805)
When I switch to asm 1.5.3, everything is fine.
I've closed this as "not a bug", since it is no XStream problem. You (or one of your dependencies) is using CGLIB which depends on ASM 1.5.x which is in turn binary incompatible with ASM 2.x and/or 3.x. The only reason why XStream triggers the problem is, because it finds CGLIB on the classpath and prepares itself to handle proxies created with CGLIB. Please ask on the list for further actions.