ldaley / grails-remote-control

Facilitates executing commands (closures) against remote or local Grails applications
Apache License 2.0
23 stars 16 forks source link

NullPointerException in RemoteControlServlet.doExecute(RemoteControlServlet.groovy:30) #5

Closed nigelpatsmith closed 10 years ago

nigelpatsmith commented 11 years ago

I'm seeing a NullPointerException whenever I make an exec() call. As far as I can tell, the calls are successful. However, I'm guessing that the error means something, not that I have seen any immediate side effects.

I'm using a custom grails environment (ie not "test"), have set remoteControl.enabled = true, and basically everything seems to be working.

The stack trace is: [http-nio-8080-exec-3] ERROR agent.SpringLoadedPreProcessor - Unexpected problem transforming call sites java.lang.NullPointerException at java.lang.ClassLoader.defineClass(ClassLoader.java:791) at java.lang.ClassLoader.defineClass(ClassLoader.java:634) at groovyx.remote.server.CommandInvoker.defineClass(CommandInvoker.groovy:73) at groovyx.remote.server.CommandInvoker.instantiate(CommandInvoker.groovy:57) at groovyx.remote.server.CommandInvoker.invokeAgainst(CommandInvoker.groovy:37) at groovyx.remote.server.CommandChainInvoker.invokeAgainst(CommandChainInvoker.groovy:37) at groovyx.remote.server.Receiver.invokeCommandChain(Receiver.groovy:129) at groovyx.remote.server.Receiver.execute(Receiver.groovy:125) at groovyx.remote.transport.http.RemoteControlServlet.doExecute(RemoteControlServlet.groovy:74) at grails.plugin.remotecontrol.RemoteControlServlet.doExecute(RemoteControlServlet.groovy:30) at groovyx.remote.transport.http.RemoteControlServlet.doPost(RemoteControlServlet.groovy:39) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)

ldaley commented 11 years ago

I'm kinda surprised you aren't seeing side effects of this.

Would you be able to provide a reproducible sample? I don't quite know what's going on.

nigelpatsmith commented 11 years ago

Hi Luke

Not sure if I'll be able to create a reproducible sample. I'm not sure which part of our grails app is causing the issue, so I'm not sure which part to send you, and I can't send you the whole app. If you can point me in the direction of what might be causing the issue, I might be able to have a dig around myself.

I can think of two things that we might be able to do:

If you have any other suggestions, I'm open to ideas.

Here is the snippet:

class TimeMachine {

def remote

TimeMachine(String machineIP, String port) {
    def transport = new HttpTransport("http://" + machineIP + ":" + port + "/grails-remote-control")
    remote = new RemoteControl(transport)
}

public void setOffsetSeconds(long seconds) {
    remote.exec { DateTimeUtils.setCurrentMillisOffset(seconds * 1000) }
}

public long getCurrentSeconds() {
    return remote.exec { new DateTime().millis / 1000 }
}

public void reset() {
    remote.exec { DateTimeUtils.setCurrentMillisSystem() }
}

}

We're calling this code from Ruby, using rjb. As you can see, we're only using it to manipulate time within our app (for anything that is coupled to joda time, which our app is)

Cheers, Nigel

On 26/01/2013, at 8:06 PM, Luke Daley notifications@github.com wrote:

I'm kinda surprised you aren't seeing side effects of this.

Would you be able to provide a reproducible sample? I don't quite know what's going on.

— Reply to this email directly or view it on GitHub.

antony commented 11 years ago

Hi Luke,

I don't know if you ever got to the bottom of this, but I have been seeing the same thing for months. Every time a remote endpoint is hit, I get:

| Error 2013-09-19 17:18:55,534 [http-bio-8080-exec-6] ERROR agent.SpringLoadedPreProcessor - Unexpected problem transforming call sites Message: null Line | Method ->> 109 | in java.lang.StringBuilder


| 792 | defineClass in java.lang.ClassLoader | 635 | defineClass . . . in '' | 73 | defineClass in groovyx.remote.server.CommandInvoker | 57 | instantiate . . . in '' | 37 | invokeAgainst in '' | 129 | invokeCommandChain in groovyx.remote.server.Receiver | 125 | execute in '' | 74 | doExecute . . . . in groovyx.remote.transport.http.RemoteControlServlet | 30 | doExecute in grails.plugin.remotecontrol.RemoteControlServlet | 39 | doPost . . . . . . in groovyx.remote.transport.http.RemoteControlServlet | 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor | 615 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker ^ 724 | run in java.lang.Thread

As you can imagine, it makes trying to look at log output whilst running tests fairly pointless, as this is almost a constant scroll.

Did you ever discover the cause?

jdbeutel commented 11 years ago

I think I am seeing the same problem, when I run functional tests against a separate run-app. The cause looks like a bug in spring-loaded (v1.1.3 in Grails 2.2.4):

The bug is that SpringLoadedPreProcessor.needsClientSideRewriting() is true for a null class name, so that class calls typeRegistry.methodCallRewriteUseCacheIfAvailable() with a null class name, but the cachekey does not handle null class names.

2013-09-26 12:25:29,657 [http-bio-8080-exec-4] ERROR StackTrace - Full Stack Trace: java.lang.NullPointerException at java.lang.StringBuilder.(StringBuilder.java:92) at org.springsource.loaded.MethodInvokerRewriter.rewriteUsingCache(MethodInvokerRewriter.java:116) at org.springsource.loaded.TypeRegistry.methodCallRewriteUseCacheIfAvailable(TypeRegistry.java:791) at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:264) at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:102) at sun.instrument.TransformerManager.transform(TransformerManager.java:169) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.lang.ClassLoader.defineClass(ClassLoader.java:465) at sun.reflect.GeneratedMethodAccessor152.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:230) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128) at groovyx.remote.server.CommandInvoker.defineClass(CommandInvoker.groovy:73) 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.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145) at groovyx.remote.server.CommandInvoker.instantiate(CommandInvoker.groovy:57) at groovyx.remote.server.CommandInvoker.invokeAgainst(CommandInvoker.groovy:37) at groovyx.remote.server.CommandInvoker$invokeAgainst.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) at groovyx.remote.server.CommandChainInvoker.invokeAgainst(CommandChainInvoker.groovy:37) 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.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:231) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145) at groovyx.remote.server.CommandChainInvoker.invokeAgainst(CommandChainInvoker.groovy) at groovyx.remote.server.CommandChainInvoker$invokeAgainst.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at groovyx.remote.server.Receiver.invokeCommandChain(Receiver.groovy:129) 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.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) at groovyx.remote.server.Receiver.execute(Receiver.groovy:125) at groovyx.remote.server.Receiver$execute.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) at groovyx.remote.transport.http.RemoteControlServlet.doExecute(RemoteControlServlet.groovy:74) at grails.plugin.remotecontrol.RemoteControlServlet.super$4$doExecute(RemoteControlServlet.groovy) 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.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1082) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1106) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128) at grails.plugin.remotecontrol.RemoteControlServlet.doExecute(RemoteControlServlet.groovy:30) at grails.plugin.remotecontrol.RemoteControlServlet$doExecute.callCurrent(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145) at groovyx.remote.transport.http.RemoteControlServlet.doPost(RemoteControlServlet.groovy:39) at grails.plugin.remotecontrol.RemoteControlServlet.doPost(RemoteControlServlet.groovy) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at grails.plugin.remotecontrol.RemoteControlServlet.service(RemoteControlServlet.groovy) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at grails.plugin.remotecontrol.RemoteControlServlet.service(RemoteControlServlet.groovy) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.processFilterChain(UrlMappingsFilter.java:377) at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:244) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:206) at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:152) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:369) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:112) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187) at org.codehaus.groovy.grails.plugins.springsecurity.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:40) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.codehaus.groovy.grails.plugins.springsecurity.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:79) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:168) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:66) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at javax.servlet.FilterChain$doFilter.call(Unknown Source) at edu.hawaii.its.taps.ActionSubmitParamFilter.doFilter(ActionSubmitParamFilter.groovy:37) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:680) 2013-09-26 12:25:29,667 [http-bio-8080-exec-4] ERROR StackTrace - Full Stack Trace: java.lang.NullPointerException at java.lang.StringBuilder.(StringBuilder.java:92) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.lang.ClassLoader.defineClass(ClassLoader.java:465) at groovyx.remote.server.CommandInvoker.defineClass(CommandInvoker.groovy:73) at groovyx.remote.server.CommandInvoker.instantiate(CommandInvoker.groovy:57) at groovyx.remote.server.CommandInvoker.invokeAgainst(CommandInvoker.groovy:37) at groovyx.remote.server.CommandChainInvoker.invokeAgainst(CommandChainInvoker.groovy:37) at groovyx.remote.server.Receiver.invokeCommandChain(Receiver.groovy:129) at groovyx.remote.server.Receiver.execute(Receiver.groovy:125) at groovyx.remote.transport.http.RemoteControlServlet.doExecute(RemoteControlServlet.groovy:74) at grails.plugin.remotecontrol.RemoteControlServlet.doExecute(RemoteControlServlet.groovy:30) at groovyx.remote.transport.http.RemoteControlServlet.doPost(RemoteControlServlet.groovy:39) at edu.hawaii.its.taps.ActionSubmitParamFilter.doFilter(ActionSubmitParamFilter.groovy:37) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:680)

jdbeutel commented 11 years ago

looks related to https://github.com/spring-projects/spring-loaded/commit/6d30e0de3eeae738cc888b8e2b6d0e5aacddbdf7

jdbeutel commented 11 years ago

Unfortunately, the problem being in an agent, I suppose I cannot just override it with a patch from my Grails app.

ldaley commented 10 years ago

Thanks for the investigation. I've asked the Spring Loaded guys to fix this.

jdbeutel commented 10 years ago

Thanks, Luke! I think the key to reproducing this is to run-app as dev, to get reloading, and then run functional tests with remote-control against that.

I am trying the following work-around, but not sure if it is a good solution:

--- a/org.springsource.loaded/src/main/java/org/springsource/loaded/agent/SpringLoadedPreProcessor.java
+++ b/org.springsource.loaded/src/main/java/org/springsource/loaded/agent/SpringLoadedPreProcessor.java
@@ -103,6 +103,9 @@ public class SpringLoadedPreProcessor implements Constants {
                if (disabled) {
                        return bytes;
                }
+        if (slashedClassName == null) {
+            slashedClassName = "null" + Utils.calculateSHA256(bytes);
+        }
            //              System.err.println("> SpringLoadedPreProcessor.preProcess(classLoader=" + classLoader + ",slashedClassName=
                //                              + slashedClassName + ",...)");

(I think I found Utils.calculateSHA256() on stackoverflow.com.)

ldaley commented 10 years ago

Thanks.

The issue I raised is here: https://github.com/spring-projects/spring-loaded/issues/24

ldaley commented 10 years ago

This will be fixed in Grails 2.4.