NoSuchMethodError

Hi.

I posted last week without any answer, so I try again with a step-by-step way to my problem. Perhaps one could help me with this?

1. Created Java project HelloWorld with defaults in the wizard dialog.
2. Added the a Groovy facet to the module.
3. Checked paths to Groovy and Grails.
4. Created a "Groovy Script" from the context menu on src called "HelloWorld". Now a green button with a G in it is in the src dir, labeled "Hello World".
5. Wrote println "hello world" in the script.
6. Run that script from the context menu in the editor (right-click in the editor). Then it compiles the script (the green G-Button turn blue with a C in it).

The output is now the following:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java -Dfile.encoding=MacRoman -classpath /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/deploy.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/dt.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/plugin.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/sa-jdi.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/charsets.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/dt.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/jconsole.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/.. /Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/apple_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/dnsns.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/localedata.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunjce_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunpkcs11.jar:/Applications/Selena-7294.app/lib/alloy.jar:/Applications/Selena-7294.app/lib/annotations.jar:/Applications/Selena-7294.app/lib/asm-commons.jar:/Applications/Selena-7294.app/lib/asm.jar:/Applications/Selena-7294.app/lib/boot.jar:/Applications/Selena-7294.app/lib/bootstrap.jar:/Applications/Selena-7294.app/lib/cglib-nodep-2.1_3.jar:/Applications/Selena-7294.app/lib/commons-codec-1.3.jar:/Applications/Selena-7294.app/lib/commons -collections.jar:/Applications/Selena-7294.app/lib/emma-agent.jar:/Applications/Selena-7294.app/lib/emma.jar:/Applications/Selena-7294.app/lib/extensions.jar:/Applications/Selena-7294.app/lib/forms_rt.jar:/Applications/Selena-7294.app/lib/icons.jar:/Applications/Selena-7294.app/lib/idea_rt.jar:/Applications/Selena-7294.app/lib/j2ee.jar:/Applications/Selena-7294.app/lib/jasper2_rt.jar:/Applications/Selena-7294.app/lib/javac2.jar:/Applications/Selena-7294.app/lib/javaee.jar:/Applications/Selena-7294.app/lib/jaxen.jar:/Applications/Selena-7294.app/lib/jdom.jar:/Applications/Selena-7294.app/lib/jgoodies-forms.jar:/Applications/Selena-7294.app/lib/jh.jar:/Applications/Selena-7294.app/lib/JNIWrap.jar:/Applications/Selena-7294.app/lib/jsf-api.jar:/Applications/Selena-7294.app/lib/jsp-api.jar:/Applications/Selena-7294.app/lib/junit-4.4.jar:/Applications/Selena-7294.app/lib/junit.jar:/Applications/Selena-7294.app/lib/log4j.jar:/Applications/Selena-7294.app/lib/m icroba.jar:/Applications/Selena-7294.app/lib/nanoxml-2.2.3.jar:/Applications/Selena-7294.app/lib/openapi.jar:/Applications/Selena-7294.app/lib/org.eclipse.jdt.core.jar:/Applications/Selena-7294.app/lib/oromatcher.jar:/Applications/Selena-7294.app/lib/picocontainer.jar:/Applications/Selena-7294.app/lib/quaqua.jar:/Applications/Selena-7294.app/lib/resolver.jar:/Applications/Selena-7294.app/lib/resources.jar:/Applications/Selena-7294.app/lib/resources_en.jar:/Applications/Selena-7294.app/lib/saxpath.jar:/Applications/Selena-7294.app/lib/servlet-api.jar:/Applications/Selena-7294.app/lib/trove4j.jar:/Applications/Selena-7294.app/lib/trove4j_src.jar:/Applications/Selena-7294.app/lib/velocity.jar:/Applications/Selena-7294.app/lib/xerces.jar:/Applications/Selena-7294.app/lib/xml-apis.jar:/Applications/Selena-7294.app/lib/xmlrpc-2.0.jar:/Applications/Selena-7294.app/lib/xstream.jar:/Applications/Selena-7294.app/lib/yjp-controller-api-redist.jar:/Applications/Sel ena-7294.app/plugins/JavaEE/lib/javaee-openapi.jar:/Applications/Selena-7294.app/plugins/JavaEE/lib/resources_en.jar:/Applications/Selena-7294.app/plugins/JSF/lib/jsf-openapi.jar:/Applications/Selena-7294.app/plugins/JSF/lib/resources_en.jar:/Users/berndschiffer/sandbox/HelloWorld/out/production/HelloWorld:/Library/groovy-1.1-beta-2/lib/ant-1.7.0.jar:/Library/groovy-1.1-beta-2/lib/ant-junit-1.7.0.jar:/Library/groovy-1.1-beta-2/lib/ant-launcher-1.7.0.jar:/Library/groovy-1.1-beta-2/lib/antlr-2.7.6.jar:/Library/groovy-1.1-beta-2/lib/asm-2.2.jar:/Library/groovy-1.1-beta-2/lib/asm-analysis-2.2.jar:/Library/groovy-1.1-beta-2/lib/asm-tree-2.2.jar:/Library/groovy-1.1-beta-2/lib/asm-util-2.2.jar:/Library/groovy-1.1-beta-2/lib/bsf-2.4.0.jar:/Library/groovy-1.1-beta-2/lib/castor-0.9.9.jar:/Library/groovy-1.1-beta-2/lib/commons-cli-1.0.jar:/Library/groovy-1.1-beta-2/lib/commons-lang-1.0.jar:/Library/groovy-1.1-beta-2/lib/commons-logging-1.0.jar:/Library/groovy-1.1- beta-2/lib/groovy-1.1-beta-2.jar:/Library/groovy-1.1-beta-2/lib/jsp-api-2.0.jar:/Library/groovy-1.1-beta-2/lib/junit-3.8.2.jar:/Library/groovy-1.1-beta-2/lib/log4j-1.2.8.jar:/Library/groovy-1.1-beta-2/lib/mockobjects-core-0.09.jar:/Library/groovy-1.1-beta-2/lib/mx4j-3.0.2.jar:/Library/groovy-1.1-beta-2/lib/openejb-loader-1.0.jar:/Library/groovy-1.1-beta-2/lib/servlet-api-2.4.jar:/Library/groovy-1.1-beta-2/lib/xpp3_min-1.1.3.4.O.jar:/Library/groovy-1.1-beta-2/lib/xstream-1.2.2.jar groovy.lang.GroovyShell /Users/berndschiffer/sandbox/HelloWorld/src/HelloWorld.groovy
Caught: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.]]>(Z)V

Process finished with exit code 1

Anyone any ideas?

Bernd

0
12 comments
Avatar
Permanently deleted user

What version of JetGroovy are you using?

0
Avatar
Permanently deleted user

Please check that ASM jars are picked up by facet: that is the global library named "GROOVY" references them.

0
Avatar
Permanently deleted user

Selena 7294 and JetGroovy 0.1.10957, Grails 0.6 and Groovy 1.1 beta 2 (not 1.0, because 1.1 beta 2 is the one Grails 0.6 uses)

0
Avatar
Permanently deleted user

Please check that ASM jars are picked up by facet:
that is the global library named "GROOVY" references
them.


I added the facet "Groovy" to my module (see module-settings.tiff). And I have the global lib "Groovy" in my project attached (see project-view.tiff). In this lib are several asm related jars.

So everythings seems to be alright, doesn't it?

Bernd



Attachment(s):
project-view.tiff
module-settings.tiff
0
Avatar
Permanently deleted user

It seems OK. I'm out of guesses, so I'll need to have a look at your project to see the problem. Is it possible?

0
Avatar
Permanently deleted user

It seems OK. I'm out of guesses, so I'll need to have
a look at your project to see the problem. Is it
possible?


Yes, of course, it's only a HelloWorld project, so it's no problem to show. I've attached it.

Thanks for your help so far.



Attachment(s):
HelloWorld.zip
0
Avatar
Permanently deleted user

Okay, everything's working now. My dear fellow Robert read this post (he's in this forum, too), found the problem and called me on the phone :)

The problem was, that on my project the IDEA-JDK was set, which has it's own asm-libs, probably incompatible with Groovy. So I switched to JDK 1.5 (my Mac's one) and the script worked just fine!

Thank you, Robert!

0
Avatar
Permanently deleted user

Aha, I see.

Still there is a bug here, though not that severe: groovy libraries should be placed before JDK...

0
Avatar
Permanently deleted user

Fixed

0
Avatar
Permanently deleted user

Bernd,
Thank you for writing the solution. I was struggling with the same problem.

Eugene,
Where was this fixed? I'm using IDEA 7.0.2 on OS X with the latest JetGroovy plugin and I still encountered the same problem. The JDK libraries are in the classpath before the groovy libraries.

0
Avatar
Permanently deleted user

Markus,

This problem is more general than I thought before, see for example http://www.jetbrains.net/jira/browse/GRVY-853. We'll provide the solution ASAP (actualy we are on holidays now in Russia, so expect an update next week)

Eugene,

0
Avatar
Permanently deleted user

Update is available in Plugin Manager.

0

Please sign in to leave a comment.