jastrachan | 6 Aug 09:59 2004

Re: Problem using compiled groovy code from standard java code

On 5 Aug 2004, at 23:34, Jeremy Aston wrote:

> If I run these via the groovy cmd line then it all works.  I have then  
> compiled the scripts into Java class files using the Ant task, then  
> jared the classes up.  I then try and call the Test1 from java code  
> and it works fine except you get the following error when the Test1  
> script attempts to create the Test2 object...
> t1.run()
> apple.awt.EventQueueExceptionHandler Caught Throwable :
> java.lang.NoSuchMethodError:  
> org.codehaus.groovy.runtime.InvokerHelper.invokeNoArgumentsConstructorO 
> f(Ljava/lang/Class;)Ljava/lang/Object;
> 	at  
> com.realitylogic.realmsPublisher.groovy.Test1.run(/sandbox/realms/ 
> realmsPublisher/src/groovy/com/realitylogic/realmsPublisher/groovy/

This looks like a bad version of groovy on your classpath. Looks like  
you've an older jar there, the compiled .class files is dependent on  
the same groovy version that you compiled it with.