quality@glassfish.java.net

[FishCAT] NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V with Groovy 1.6.3

From: Jacek Laskowski <jacek_at_laskowski.net.pl>
Date: Tue, 29 Sep 2009 15:00:04 +0200

Hi,

I've tried to run a groovy script to access GF. It seems that Groovy's
asm jar conflicts with the one provided by GF.
$GLASSFISHv3_HOME/glassfish/modules/asm-all-repackaged.jar seems to be
a repackaged version of ASM, but the packages inside are in tact -
org.objectweb.asm. It's a known issue with ASM between its versions so
without repackaging it won't simply work. Any hints appreciated. Shall
I report it as an issue?

$ c\:/apps/glassfishv3/bin/asadmin.bat version
Version = GlassFish v3 (build 65)
Command version executed successfully.

$ groovysh --version
Groovy Shell 1.6.3

$ CLASSPATH="c:\apps\glassfishv3\glassfish\lib\jndi-properties.jar;c:\apps\glassfishv3\glassfish\lib\appserv-rt.jar"
groovysh
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:108)
        at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
        at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compilePogoMethod(CallSiteGenerator.java:207)
        at org.codehaus.groovy.reflection.CachedMethod.createPogoMetaMethodSite(CachedMethod.java:216)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.createCachedMethodSite(PogoMetaMethodSite.java:206)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.createPogoMetaMethodSite(PogoMetaMethodSite.java:182)
        at groovy.lang.MetaClassImpl.createPogoCallCurrentSite(MetaClassImpl.java:3024)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallCurrentSite(CallSiteArray.java:93)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:159)
        at groovy.util.CliBuilder.invokeMethod(CliBuilder.groovy:54)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:129)
        at org.codehaus.groovy.tools.shell.Main.main(Main.groovy:42)
        ... 6 more

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl