Just having groovypp-all.jar in path causes an error

103 views
Skip to first unread message

Jim Morris

unread,
Jul 3, 2011, 7:05:10 PM7/3/11
to groovyp...@googlegroups.com
Hi,

I added groovypp-0.4.268_1.8.0.jar to my build path in eclipse and one of my groovy files gives the following error (in eclipse)

Internal compiler error: java.lang.AbstractMethodError: org.codehaus.groovy.classgen.BytecodeInstruction.visit(Lorg/objectweb/asm/MethodVisitor;)V at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:266)    Comms.groovy    /Rovio/src/main/groovy/com/e4net/rovio/comms    line 0    Java Problem

I have groovy-all-1.8.0.jar in my buildpath too, and I have no @Typed annotations set in any of the files, just adding the groovypp causes this.

If I try to build with buildr I get...

E, [2011-07-03T16:01:48.992999 #27717] ERROR -- : Error instantiating 'groovyc' task: groovyjarjarasm/asm/Opcodes
Buildr aborted!
NoClassDefFoundError : groovyjarjarasm/asm/Opcodes


Any ideas?

Daniel Henrique Alves Lima

unread,
Jul 3, 2011, 10:41:28 PM7/3/11
to groovyp...@googlegroups.com

Jim Morris

unread,
Jul 4, 2011, 3:30:58 AM7/4/11
to groovyp...@googlegroups.com
Ok Thanks for the pointer

That certainly clears up the compile error in eclipse but now it won't run, because running does use groovy-all and thus requires groovypp-all... Exception shown at end.

Its odd that the error is when it is trying to instantiate logback though, although that just maybe the first class it tries to load.

Note I am using groovy 1.8 and the latest snapshot of groovy-eclipse.

Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.NoClassDefFoundError: org/objectweb/asm/Opcodes
...
Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.Opcodes
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

Jim Morris

unread,
Jul 4, 2011, 3:46:36 AM7/4/11
to groovyp...@googlegroups.com
Although switching to groovy-pp in the compile-with clause in buildr fixed that and then using groovypp-all for running works fine. So that fixes it there.

So the question (and maybe I need to move this to groovy-eclipse ML) is how do you get ecllipse to compile with groovypp and run with groovypp-all?

I removed the groovy-all from my referenced libraries and told eclipse to include groovy jars, but I still get the same error when I try to run it, with just groovypp, again it is when it tries to load logback, maybe there is a conflict with logback and grooypp in eclipse?


Jim Morris

unread,
Jul 4, 2011, 4:12:49 AM7/4/11
to groovyp...@googlegroups.com
Ok so this is a real pain.

So the solution appears to be to use groovypp.jar in the buildpath for compilation, then you have to go to the run configurations and delete the default classpath, and manually add all the runtime libraries, which is almost identical to the default except you need to use groovypp-all instead of groovypp.

This is very ugly!

I think I'll post a request for improvement to the eclipse-groovy Jira as there has to be a better way.


Daniel Henrique

unread,
Jul 4, 2011, 9:55:42 AM7/4/11
to Groovy++
Hi Jim.


On Jul 4, 5:12 am, Jim Morris <wolfma...@gmail.com> wrote:
> Ok so this is a real pain.

Yes, I'm familiar with the feeling.

>
> So the solution appears to be to use groovypp.jar in the buildpath for
> compilation, then you have to go to the run configurations and delete the
> default classpath, and manually add all the runtime libraries, which is
> almost identical to the default except you need to use groovypp-all instead
> of groovypp.
>
> This is very ugly!

Try creating a new test project using Groovy Eclipse and Groovy++,
remove groovy-all from "Groovy Libraries" dependencies and use groovy
and groovypp (without all) and related dependencies.

>
> I think I'll post a request for improvement to the eclipse-groovy Jira as
> there has to be a better way.

I like Groovy++, but I almost gave up of using Groovy Eclipse and
Groovy++ together or even use Groovy++ :-(

Good luck.

Best regards,

Daniel.

Alex Tkachman

unread,
Jul 4, 2011, 11:18:14 AM7/4/11
to groovyp...@googlegroups.com
Use Intellij. Their Community Edition is perfect for Groovy/Groovy++

Jim Morris

unread,
Jul 5, 2011, 12:53:26 AM7/5/11
to groovyp...@googlegroups.com
Thanks to help from Andy Clement of GRECLIPSE fame, I now know what the causes are, and document it here for any future googlers.

Using groovy++ in Eclipse does indeed require the use of groovypp.jar and not groovypp-all.jar. the former must be added to the build path.

The issues I was having then running was caused by logback which when used with the logback.groovy configuration file attempts to compile it, and this detects that the asm-3.2.jar is not available and gives an error.

The simplest workaround is to add asm-3.2.jar to the classpath, or use logback.xml to configure logback.

Either way I can now use groovy++ in my eclipse project without further errors.

The full analysis is here https://jira.codehaus.org/browse/GRECLIPSE-1070, and if you want seemless groovy++ integration in greclipse in the future vote for it ;)

Thanks Andy :)



Reply all
Reply to author
Forward
0 new messages