gretty-gradle-plugin / gretty

Advanced gradle plugin for running web-apps on jetty and tomcat.
MIT License
129 stars 36 forks source link

Issues running with managedClassReload=true #310

Open maylorian opened 3 months ago

maylorian commented 3 months ago

Hi, thanks for the plugin!

7I try to run a project with java 17, jetty10, tapestry and gretty 3.1.4, however, when I run it with managedClassReload = true, I get an error:

java.lang.NoClassDefFoundError: org/springsource/loaded/TypeRegistry

Running with managedClassReload false works just fine. I've tried adding springloaded as a dependency but no luck.

Am I doing something wrong?

java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira
    at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:110)
    at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244)
    at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:541)
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.System$2.defineClass(System.java:2303)
    at java.base/java.lang.reflect.Proxy$ProxyBuilder.defineProxyClass(Proxy.java:560)
    at java.base/java.lang.reflect.Proxy$ProxyBuilder.build(Proxy.java:670)
    at java.base/java.lang.reflect.Proxy.lambda$getProxyConstructor$0(Proxy.java:429)
    at java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329)
    at java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205)
    at java.base/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:427)
    at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1037)
    at java.base/sun.reflect.annotation.AnnotationParser$1.run(AnnotationParser.java:302)
    at java.base/sun.reflect.annotation.AnnotationParser$1.run(AnnotationParser.java:300)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at java.base/sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:300)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:289)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:121)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:73)
    at java.base/java.lang.reflect.Executable.declaredAnnotations(Executable.java:625)
    at java.base/java.lang.reflect.Executable.declaredAnnotations(Executable.java:623)
    at java.base/java.lang.reflect.Executable.getAnnotation(Executable.java:591)
    at java.base/java.lang.reflect.Method.getAnnotation(Method.java:738)
    at java.desktop/com.sun.beans.introspect.PropertyInfo.initialize(PropertyInfo.java:131)
    at java.desktop/com.sun.beans.introspect.PropertyInfo.initialize(PropertyInfo.java:122)
    at java.desktop/com.sun.beans.introspect.PropertyInfo.get(PropertyInfo.java:308)
    at java.desktop/com.sun.beans.introspect.ClassInfo.getProperties(ClassInfo.java:91)
    at java.desktop/java.beans.Introspector.getTargetPropertyInfo(Introspector.java:500)
    at java.desktop/java.beans.Introspector.getBeanInfo(Introspector.java:448)
    at java.desktop/java.beans.Introspector.getBeanInfo(Introspector.java:195)
    at groovy.lang.MetaClassImpl.lambda$addProperties$8(MetaClassImpl.java:3401)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
    at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3401)
    at groovy.lang.MetaClassImpl.reinitialize(MetaClassImpl.java:3383)
    at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3376)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:273)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:315)
    at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:258)
    at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:994)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallConstructorSite(CallSiteArray.java:82)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:268)
    at org.akhikhl.gretty.Runner.main(Runner.groovy:27)
Caused by: java.lang.IllegalArgumentException
    at sl.org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at sl.org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at org.springsource.loaded.Utils.discoverInterfaces(Utils.java:1844)
    at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:278)
    at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:107)
    ... 44 more
java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira
    at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:110)
    at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244)
    at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:541)
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.System$2.defineClass(System.java:2303)
    at java.base/java.lang.reflect.Proxy$ProxyBuilder.defineProxyClass(Proxy.java:560)
    at java.base/java.lang.reflect.Proxy$ProxyBuilder.build(Proxy.java:670)
    at java.base/java.lang.reflect.Proxy.lambda$getProxyConstructor$0(Proxy.java:429)
    at java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329)
    at java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205)
    at java.base/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:427)
    at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1037)
    at java.base/sun.reflect.annotation.AnnotationParser$1.run(AnnotationParser.java:302)
    at java.base/sun.reflect.annotation.AnnotationParser$1.run(AnnotationParser.java:300)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at java.base/sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:300)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:289)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:121)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:73)
    at java.base/java.lang.reflect.Executable.declaredAnnotations(Executable.java:625)
    at java.base/java.lang.reflect.Executable.declaredAnnotations(Executable.java:623)
    at java.base/java.lang.reflect.Executable.getAnnotation(Executable.java:591)
    at java.base/java.lang.reflect.Method.getAnnotation(Method.java:738)
    at java.desktop/com.sun.beans.introspect.PropertyInfo.initialize(PropertyInfo.java:131)
    at java.desktop/com.sun.beans.introspect.PropertyInfo.initialize(PropertyInfo.java:122)
    at java.desktop/com.sun.beans.introspect.PropertyInfo.get(PropertyInfo.java:308)
    at java.desktop/com.sun.beans.introspect.ClassInfo.getProperties(ClassInfo.java:91)
    at java.desktop/java.beans.Introspector.getTargetPropertyInfo(Introspector.java:500)
    at java.desktop/java.beans.Introspector.getBeanInfo(Introspector.java:448)
    at java.desktop/java.beans.Introspector.getBeanInfo(Introspector.java:195)
    at groovy.lang.MetaClassImpl.lambda$addProperties$8(MetaClassImpl.java:3401)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
    at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3401)
    at groovy.lang.MetaClassImpl.reinitialize(MetaClassImpl.java:3383)
    at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3376)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:273)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:315)
    at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:258)
    at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:994)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallConstructorSite(CallSiteArray.java:82)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:268)
    at org.akhikhl.gretty.Runner.main(Runner.groovy:27)
Caused by: java.lang.IllegalArgumentException
    at sl.org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at sl.org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at org.springsource.loaded.Utils.discoverInterfaces(Utils.java:1844)
    at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:278)
    at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:107)
    ... 44 more
Exception in thread "main" java.lang.InternalError: java.lang.NoClassDefFoundError: org/springsource/loaded/TypeRegistry
    at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1061)
    at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1039)
    at java.base/sun.reflect.annotation.AnnotationParser$1.run(AnnotationParser.java:302)
    at java.base/sun.reflect.annotation.AnnotationParser$1.run(AnnotationParser.java:300)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at java.base/sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:300)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:289)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:121)
    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:73)
    at java.base/java.lang.reflect.Executable.declaredAnnotations(Executable.java:625)
    at java.base/java.lang.reflect.Executable.declaredAnnotations(Executable.java:623)
    at java.base/java.lang.reflect.Executable.getAnnotation(Executable.java:591)
    at java.base/java.lang.reflect.Method.getAnnotation(Method.java:738)
    at java.desktop/com.sun.beans.introspect.PropertyInfo.initialize(PropertyInfo.java:131)
    at java.desktop/com.sun.beans.introspect.PropertyInfo.initialize(PropertyInfo.java:122)
    at java.desktop/com.sun.beans.introspect.PropertyInfo.get(PropertyInfo.java:308)
    at java.desktop/com.sun.beans.introspect.ClassInfo.getProperties(ClassInfo.java:91)
    at java.desktop/java.beans.Introspector.getTargetPropertyInfo(Introspector.java:500)
    at java.desktop/java.beans.Introspector.getBeanInfo(Introspector.java:448)
    at java.desktop/java.beans.Introspector.getBeanInfo(Introspector.java:195)
    at groovy.lang.MetaClassImpl.lambda$addProperties$8(MetaClassImpl.java:3401)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
    at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3401)
    at groovy.lang.MetaClassImpl.reinitialize(MetaClassImpl.java:3383)
    at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3376)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:273)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:315)
    at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:258)
    at groovy.lang.MetaClassImpl.pickStaticMethod(MetaClassImpl.java:1586)
    at groovy.lang.MetaClassImpl.getStaticMetaMethod(MetaClassImpl.java:320)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.getDelegateMethod(ClosureMetaClass.java:204)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:308)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:61)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:194)
    at org.akhikhl.gretty.Runner$_main_closure1.doCall(Runner.groovy:29)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1427)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)
    at groovy.lang.Closure.call(Closure.java:427)
    at groovy.lang.Closure.call(Closure.java:416)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.with(DefaultGroovyMethods.java:360)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.with(DefaultGroovyMethods.java:305)
    at org.codehaus.groovy.runtime.dgm$882.invoke(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoMetaMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:222)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:69)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
    at org.akhikhl.gretty.Runner.main(Runner.groovy:28)
Caused by: java.lang.NoClassDefFoundError: org/springsource/loaded/TypeRegistry
    at java.base/jdk.internal.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1053)
    ... 56 more