Hi, I'm currently evaluating JRebel 2.1a for my company. We make extensive use of groovy here, and I've yet to get jrebel working correctly with it. It seems even adding a line of code and recompiling causes anything involving groovy closures to get messed up. I've created a simple groovy example that duplicates this problem:
public class GroovyTest {
public test(){
System.out.println("time:"+System.currentTimeMillis())
// Run, uncomment the line below, and recompile to generate the error
//["a","b","c"].each { String s -> }
[0,1,2].each { int i -> }
["a","b","c"].each { String s -> }
}
public static void main(String... args){
while(true){
Thread.sleep(2000)
new GroovyTest().test()
}
}
}
When I run this, then uncomment the commented line of code and recompile, I get the following output:
=============================== [JRebel Spring Framework Plugin DISABLED] ==============================
You can enable Spring Framework Plugin by setting -Drebel.spring_plugin=true.
------------------------------------------------------------------------------------------
Description: Supports adding new beans and adding new bean dependencies using
annotations or XML. Singletons will be reconfigured after the change. It also
supports adding or changing Spring MVC controllers or handlers.
=============================== [/JRebel Spring Framework Plugin DISABLED] =============================
#############################################################
JRebel 2.1a (200910071200)
(c) Copyright ZeroTurnaround, Ltd, 2007-2009. All rights reserved.
A rough estimate: Over the last 1 days JRebel
prevented the need for at least 14 redeploys/restarts.
Using industry standard build and redeploy times,
JRebel saved you between 0.4 and 0.8 hours.
You are running JRebel evaluation license.
You have 29 days until the license expires.
You will see this notification until you obtain a
full license for your installation.
Visit http://www.jrebel.com for instructions on obtaining
a full license. If you wish to continue your evaluation
please e-mail to support@zeroturnaround.com.
If you think you should not see this message contact
support@zeroturnaround.com or check that you have your
license file in the same directory as the JAR file.
#############################################################
time:1256921946892
time:1256921948939
time:1256921950940
time:1256921952941
time:1256921954941
JRebel: Reloading class 'GroovyTest'.
JRebel: Class 'GroovyTest has a new static field '__timeStamp__239_neverHappen1256921956399' of type 'java.lang.Long' and it will not be initialized!
time:1256921956976
JRebel: Reloading class 'GroovyTest$_test_closure1'.
Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: GroovyTest$_test_closure1.doCall() is applicable for argument types: (java.lang.String) values: [a]
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:265)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:880)
at groovy.lang.Closure.call(Closure.java:279)
at GroovyTest$_test_closure1.call(GroovyTest.groovy:50001)
at groovy.lang.Closure.call(Closure.java:292)
at GroovyTest$_test_closure1.call(GroovyTest.groovy:50001)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1165)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1141)
at org.codehaus.groovy.runtime.dgm$96.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:270)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at GroovyTest$$M$90a4ef9c.test(GroovyTest.groovy:19)
at GroovyTest$$A$90a4ef9c.test(<generated>)
at GroovyTest.test(GroovyTest.groovy:21)
at GroovyTest$test.call(Unknown Source)
at GroovyTest.main(GroovyTest.groovy:28)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
