spring-loaded icon indicating copy to clipboard operation
spring-loaded copied to clipboard

Multiple NullPointerException's in SpringLoadedPreProcessor

Open damluar opened this issue 9 years ago • 16 comments

I'm using Grails 3.0.4, which in turn depends on org.springframework:springloaded: -> 1.2.4.RELEASE and during application start I get multiple exceptions like the following:

Caused by: java.lang.NullPointerException
at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:217)
at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:107)
... 135 more
java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira

The stack trace even includes a couple of my classes, which were not changed at all:

java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira
at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:110)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at sun.misc.Unsafe.defineAnonymousClass(Native Method)
at java.lang.invoke.InnerClassLambdaMetafactory.spinInnerClass(InnerClassLambdaMetafactory.java:324)
at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:194)
at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:304)
at java.lang.invoke.CallSite.makeSite(CallSite.java:302)
at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:307)
at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:297)
at com.mypackage.EndOfDayProviderImpl.doReadEodFile(EndOfDayProviderImpl.java:457)
at com.mypackage.EndOfDayProviderImpl.readEodFile(EndOfDayProviderImpl.java:542)
at com.mypackage.EndOfDayProviderImpl.afterPropertiesSet(EndOfDayProviderImpl.java:330)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at grails.boot.GrailsApp.run(GrailsApp.groovy:52)
at grails.boot.GrailsApp.run(GrailsApp.groovy:322)
at grails.boot.GrailsApp.run(GrailsApp.groovy:311)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:46)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:91)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.mypackage.Application.main(Application.groovy:10)

Exceptions don't crash the application and reloading seems to work fine, but it pollutes the log which is really annoying.

damluar avatar Aug 27 '15 14:08 damluar

Same problem here with Grails 3.0.11 (springloaded 1.2.5).

All of the exceptions have one thing in common: they seem to be caused by Java 1.8 lambdas (myList.forEach(item -> {})) as well as method references (Double::valueOf), as marked with >>> in the stacktrace below. When I replace those lambdas and method references with traditional Java constructs, those exceptions disappear.

java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira
    at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:110)
    at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
    at sun.misc.Unsafe.defineAnonymousClass(Native Method)
    at java.lang.invoke.InnerClassLambdaMetafactory.spinInnerClass(InnerClassLambdaMetafactory.java:324)
    at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:194)
    at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:304)
    at java.lang.invoke.CallSite.makeSite(CallSite.java:289)
    at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:296)
>>> at MyJavaClass.myMethod(MyJavaClass.java:260) // lambda used here
    at MyJavaClass$myMethod$0.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at webapp.MyGrailsService.myMethod(MyGrailsService.groovy:79)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
    at webapp.MyGrailsController.myMethod(MyGrailsController.groovy:25)
    at webapp.MyGrailsController$action$0.call(Unknown Source)
    at webapp.MyGrailsController.myOtherMethod(MyGrailsController.groovy:39)
    at webapp.MyGrailsController$$FastClassByCGLIB$$747d30a5.invoke(<generated>)
    at org.springframework.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
    at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:172)
    at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
    at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:299)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83)
    at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:300)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:102)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:73)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:76)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:497)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
    at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:217)
    at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:107)
    ... 84 more

jokalincke avatar Jan 06 '16 15:01 jokalincke

A similar issue occurs if using the javamoney implementation compile 'org.javamoney:moneta:1.0'. For example the call to javax.money.Monetary.getCurrency("USD"); fails with java.lang.ClassNotFoundException: javax.money.Monetary caused by

Caused by: java.lang.NullPointerException
        at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:217)
        at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:107)
        ... 131 more

flofreud avatar Jan 07 '16 15:01 flofreud

faced this issue today with a class in a lib jar that used a java 8 method reference (Foo::bar)

zyro23 avatar Jan 07 '16 16:01 zyro23

There are test cases with method references in already that are passing and I tried to create a basic test case using Monetary.getCurrency("USD"); and lambdas and a variety of method references but they all work (tried with 1.2.5 release and 1.2.6 snapshots). Can anyone point me to a sample project that fails with this problem? i.e. the: Caused by: java.lang.NullPointerException at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:217)

aclement avatar Jan 16 '16 06:01 aclement

sample app pushed: https://github.com/zyro23/spring-loaded-138 gradlew bootRun should show the exception (grails-app/init/BootStrap.groovy is using Monetary.getCurrency("USD")). it is a grails-3.1.0.RC1 app so that should be spring-boot-1.3.1 and spring-loaded-1.2.5

zyro23 avatar Jan 16 '16 07:01 zyro23

Thanks for the sample, very helpful. I can see the difference. In the grails case and my very simple standalone case a null classname is passed into the agent but whether we reach the line that NPEs depends on whether inclusion patterns have been specified. In the grails case the inclusions=grails.plugins..* has been specified, whilst in my scenario there are no inclusions. This disturbs the code paths enough that my standalone case never runs the line that NPEs and indeed, if I insert an inclusion in my sample, it fails.

The simplest fix is perhaps to recognize when a classname is null and just retrieve it from the byte code that has been passed in (because even if the caller doesn't bother to pass the classname, they always pass the byte code which has the classname inside). With this change, the grails case and my simple case work just fine. I decided to print the list of 'null classnames' that get discovered when grails starts up with my change in place to see what other classes we would start processing with this change in place and they were all related to lambdas and method handles (the LambdaMetaFactory that spins up classes on the fly to satisfy usage of these constructs is just never passing a real classname through). Previously in some places we were treating null as meaning 'this is probably a system class' but given that it can be for a type created for lambda usage anywhere, I think we should not consider it always a system class and allow regular processing. If it is for a system class (e.g. a lambda usage in a java/lang type) then package name analysis will do the right thing to consider it a system class.

I've committed these changes, please try out the next 1.2.6 build snapshot.

aclement avatar Jan 19 '16 06:01 aclement

Hmm, well scratch some of that. The more advanced Java8 regression tests don't like letting all these new lambda support generated classes through. So I'm trying a more basic strategy. It passes my test case (with inclusions passed in), the test sample app supplied above and all the regression tests. Should be in snapshots shortly. Please let me know if you try it out and whether it helps.

aclement avatar Jan 19 '16 07:01 aclement

I think this is a link to the build containing the changes: https://repo.spring.io/libs-snapshot-local/org/springframework/springloaded/1.2.6.BUILD-SNAPSHOT/springloaded-1.2.6.BUILD-20160119.073648-7.jar

aclement avatar Jan 19 '16 07:01 aclement

as far as my repro sample is concerned, i can confirm the fix: https://github.com/zyro23/spring-loaded-138/commit/77b58d46a626a830cf05cc6db70b1df5a439b36e - no more error/exception/stacktrace

zyro23 avatar Jan 19 '16 08:01 zyro23

I can confirm as well, zero NPEs with the 1.2.6 snapshot. Thanks so much.

jokalincke avatar Jan 19 '16 10:01 jokalincke

I also confirm that zero NPEs with the 1.2.6 snapshot, here we are using JBoss 6.0.1 EAP but getting below exception and hot swapping seems not working.

17:23:44,172 ERROR [stderr](MSC service thread 1-2) java.lang.reflect.InvocationTargetException

17:23:44,172 ERROR [stderr](MSC service thread 1-2) at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)

17:23:44,172 ERROR [stderr](MSC service thread 1-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

17:23:44,172 ERROR [stderr](MSC service thread 1-2) at java.lang.reflect.Method.invoke(Method.java:606)

17:23:44,172 ERROR [stderr](MSC service thread 1-2) at java.io.ObjectStreamClass.__sljlcgdc(ObjectStreamClass.java)

17:23:44,172 ERROR [stderr](MSC service thread 1-2) at java.io.ObjectStreamClass.getExternalizableConstructor(ObjectStreamClass.java:1346)

17:23:44,172 ERROR [stderr](MSC service thread 1-2) at java.io.ObjectStreamClass.access$1400(ObjectStreamClass.java:72)

17:23:44,172 ERROR [stderr](MSC service thread 1-2) at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:491)

17:23:44,172 ERROR [stderr](MSC service thread 1-2) at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:468)

17:23:44,172 ERROR [stderr](MSC service thread 1-2) at java.security.AccessController.doPrivileged(Native Method)

17:23:44,173 ERROR [stderr](MSC service thread 1-2) at java.io.ObjectStreamClass.(ObjectStreamClass.java:468)

17:23:44,173 ERROR [stderr](MSC service thread 1-2) at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:365)

17:23:44,173 ERROR [stderr](MSC service thread 1-2) at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:210)

17:23:44,173 ERROR [stderr](MSC service thread 1-2) at org.jgroups.conf.ClassConfigurator.init(ClassConfigurator.java:79)

17:23:44,173 ERROR [stderr](MSC service thread 1-2) at org.jgroups.conf.ClassConfigurator.getInstance(ClassConfigurator.java:116)

17:23:44,173 ERROR [stderr](MSC service thread 1-2) at org.jgroups.stack.ProtocolStack.(ProtocolStack.java:44)

17:23:44,173 ERROR [stderr](MSC service thread 1-2) at org.jgroups.JChannel.init(JChannel.java:1576)

17:23:44,173 ERROR [stderr](MSC service thread 1-2) at org.jgroups.JChannel.(JChannel.java:248)

17:23:44,173 ERROR [stderr](MSC service thread 1-2) at org.jgroups.JChannel.(JChannel.java:231)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at org.jboss.cache.RPCManagerImpl.initialiseChannelAndRpcDispatcher(RPCManagerImpl.java:568)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at org.jboss.cache.RPCManagerImpl.start(RPCManagerImpl.java:336)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at java.lang.reflect.Method.invoke(Method.java:606)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at org.jboss.cache.util.reflect.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:144)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at org.jboss.cache.factories.ComponentRegistry$PrioritizedMethod.invoke(ComponentRegistry.java:1012)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at org.jboss.cache.factories.ComponentRegistry.internalStart(ComponentRegistry.java:778)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at org.jboss.cache.factories.ComponentRegistry.start(ComponentRegistry.java:632)

17:23:44,174 ERROR [stderr](MSC service thread 1-2) at org.jboss.cache.invocation.CacheInvocationDelegate.start(CacheInvocationDelegate.java:345)

17:23:44,175 ERROR [stderr](MSC service thread 1-2) at com.imany.foundation.util.AbstractCacheFactory.createConfigCache(AbstractCacheFactory.java:436)

17:23:44,175 ERROR [stderr](MSC service thread 1-2) at com.imany.foundation.util.AbstractCacheFactory.getCache(AbstractCacheFactory.java:178)

17:23:44,175 ERROR [stderr](MSC service thread 1-2) at com.imany.foundation.util.AbstractCacheFactory.getDefaultCache(AbstractCacheFactory.java:156)

17:23:44,175 ERROR [stderr](MSC service thread 1-2) at com.imany.foundation.configuration.ConfigurationManager.obtainEcmConfiguration(ConfigurationManager.java:621)

17:23:44,184 ERROR [stderr](MSC service thread 1-2) at com.imany.foundation.configuration.ConfigurationManager.getAllConfigurationNames(ConfigurationManager.java:38)

17:23:44,184 ERROR [stderr](MSC service thread 1-2) at com.imany.foundation.configuration.ejb.ConfigurationServiceSessionEJB.getAllConfigurationNames(ConfigurationServiceSessionEJB.java:107)

17:23:44,185 ERROR [stderr](MSC service thread 1-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

17:23:44,186 ERROR [stderr](MSC service thread 1-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

17:23:44,186 ERROR [stderr](MSC service thread 1-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

17:23:44,186 ERROR [stderr](MSC service thread 1-2) at java.lang.reflect.Method.invoke(Method.java:606)

17:23:44,186 ERROR [stderr](MSC service thread 1-2) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)

17:23:44,186 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)

17:23:44,187 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,187 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

17:23:44,187 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36)

17:23:44,187 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,187 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)

17:23:44,187 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,187 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

17:23:44,187 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,188 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

17:23:44,188 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,188 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

17:23:44,188 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)

17:23:44,188 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,188 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

17:23:44,204 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,205 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:209)

17:23:44,205 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ejb3.tx.CMTTxInterceptor.notSupported(CMTTxInterceptor.java:286)

17:23:44,205 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:186)

17:23:44,205 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,205 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:79)

17:23:44,205 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,205 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

17:23:44,205 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,205 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:42)

17:23:44,206 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,206 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)

17:23:44,206 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,206 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

17:23:44,206 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,206 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32)

17:23:44,206 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,212 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

17:23:44,213 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

17:23:44,213 ERROR [stderr](MSC service thread 1-2) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

17:23:44,213 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)

17:23:44,213 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:221)

17:23:44,213 ERROR [stderr](MSC service thread 1-2) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)

17:23:44,213 ERROR [stderr](MSC service thread 1-2) at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:42)

17:23:44,214 ERROR [stderr](MSC service thread 1-2) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)

17:23:44,214 ERROR [stderr](MSC service thread 1-2) at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:125)

17:23:44,214 ERROR [stderr](MSC service thread 1-2) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)

17:23:44,214 ERROR [stderr](MSC service thread 1-2) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)

17:23:44,214 ERROR [stderr](MSC service thread 1-2) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)

17:23:44,214 ERROR [stderr](MSC service thread 1-2) at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)

17:23:44,214 ERROR [stderr](MSC service thread 1-2) at com.sun.proxy.$Proxy31.getAllConfigurationNames(Unknown Source)

17:23:44,215 ERROR [stderr](MSC service thread 1-2) at com.imany.foundation.webapp.bootstrap.BootstrapServlet.preLoadCaches(BootstrapServlet.java:299)

17:23:44,215 ERROR [stderr](MSC service thread 1-2) at com.imany.foundation.webapp.bootstrap.BootstrapServlet.init(BootstrapServlet.java:93)

17:23:44,215 ERROR [stderr](MSC service thread 1-2) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202)

17:23:44,215 ERROR [stderr](MSC service thread 1-2) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102)

17:23:44,215 ERROR [stderr](MSC service thread 1-2) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655)

17:23:44,215 ERROR [stderr](MSC service thread 1-2) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873)

17:23:44,216 ERROR [stderr](MSC service thread 1-2) at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:89)

17:23:44,216 ERROR [stderr](MSC service thread 1-2) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

17:23:44,219 ERROR [stderr](MSC service thread 1-2) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

17:23:44,219 ERROR [stderr](MSC service thread 1-2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

17:23:44,219 ERROR [stderr](MSC service thread 1-2) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

17:23:44,220 ERROR [stderr](MSC service thread 1-2) at java.lang.Thread.run(Thread.java:724)

17:23:44,224 ERROR [stderr](MSC service thread 1-2) Caused by: java.lang.NoSuchMethodException: org.jgroups.Address.()

17:23:44,225 ERROR [stderr](MSC service thread 1-2) at java.lang.Class.getConstructor0(Class.java:2800)

17:23:44,225 ERROR [stderr](MSC service thread 1-2) at java.lang.Class.getDeclaredConstructor(Class.java:2043)

17:23:44,225 ERROR [stderr](MSC service thread 1-2) at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassGetDeclaredConstructor(ReflectiveInterceptor.java:476)

17:23:44,225 ERROR [stderr](MSC service thread 1-2) ... 99 more

jigneshpatel34 avatar Jan 19 '16 12:01 jigneshpatel34

Still happening on grails 3.1.4

wholenewstrain avatar Mar 29 '16 02:03 wholenewstrain

@wholenewstrain Grails 3.1.4 includes springloaded 1.2.5 - so I'd recommend patching your grails to try springloaded 1.2.6 snapshots.

@jigneshpatel34 looks like that needs a new issue raising.

aclement avatar Mar 30 '16 19:03 aclement

sring 5.0.5 , springloaded 1.2.6-1.2.8 release . same issues

java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:110) at sun.instrument.TransformerManager.transform(TransformerManager.java:188) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1427) at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:459) at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:336) at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93) at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91) at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61) at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116) at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291) at org.springframework.cglib.reflect.FastClass$Generator.create(FastClass.java:65) at org.springframework.cglib.proxy.MethodProxy.helper(MethodProxy.java:121) at org.springframework.cglib.proxy.MethodProxy.init(MethodProxy.java:75) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:202) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NullPointerException at org.springsource.loaded.agent.ReloadableFileChangeListener.register(ReloadableFileChangeListener.java:115) at org.springsource.loaded.TypeRegistry.monitorForUpdates(TypeRegistry.java:1974) at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:343) at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:107) ... 30 more

yarhoo avatar Apr 03 '19 07:04 yarhoo

I think this is a link to the build containing the changes: https://repo.spring.io/libs-snapshot-local/org/springframework/springloaded/1.2.6.BUILD-SNAPSHOT/springloaded-1.2.6.BUILD-20160119.073648-7.jar

@aclement where did you put the jar? I put mine in C:.sdkman\candidates\grails\2.4.5\lib\org.springframework\springloaded\jars

I'm using springloaded-1.2.6.BUILD-20160119.073648-7.jar (Inside the jars folder:org.springframework\springloaded\jars) It comes by default with springloaded 1.2.3.RELEASE.jar , Grails 2.4.5, Spring 4.0.9.RELEASE and JDK 1.8_333 and it didn't solve my issue.

axelkouassi avatar Jul 09 '22 21:07 axelkouassi

I think this is a link to the build containing the changes: https://repo.spring.io/libs-snapshot-local/org/springframework/springloaded/1.2.6.BUILD-SNAPSHOT/springloaded-1.2.6.BUILD-20160119.073648-7.jar

@aclement where did you put the jar? I put mine in C:.sdkman\candidates\grails\2.4.5\lib\org.springframework\springloaded\jars

I'm using springloaded-1.2.6.BUILD-20160119.073648-7.jar (Inside the jars folder:org.springframework\springloaded\jars) It comes by default with springloaded 1.2.3.RELEASE.jar , Grails 2.4.5, Spring 4.0.9.RELEASE and JDK 1.8_333 and it didn't solve my issue.

@aclement I had to put the jar in C:.m2\repository\org\springframework\springloaded\1.2.4.RELEASE and rename it springloaded-1.2.4.RELEASE.jar in order to avoid that error in the console. If the name isn't exactly springloaded-1.2.4.RELEASE.jar, somehow, since maven is the one running the project through the grails-maven-plugin, it just download the C:.m2\repository\org\springframework\springloaded\1.2.4.RELEASE from the online maven repository and the original springloaded-1.2.4.RELEASE.jar is the one that comes with the issues when enabling the fork mode and the live reloading.

I'm not sure if that will create other issues when I deploy on the server, but so far it deals with the errors I was getting on the console.

Thank you.

axelkouassi avatar Jul 11 '22 00:07 axelkouassi