Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update from 1.11.1 to 1.12.0 error #186

Closed
yyi opened this issue Dec 22, 2020 · 6 comments
Closed

update from 1.11.1 to 1.12.0 error #186

yyi opened this issue Dec 22, 2020 · 6 comments
Assignees
Labels
Milestone

Comments

@yyi
Copy link

yyi commented Dec 22, 2020

[ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.12.0:compile (default) on project springboot-groovy-demo: Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: startup failed:
[ERROR] General error during conversion: java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
[ERROR]
[ERROR] java.lang.RuntimeException: java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
[ERROR] at org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:976)
[ERROR] at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:671)
[ERROR] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:635)
[ERROR] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:610)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at org.codehaus.gmavenplus.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:214)
[ERROR] at org.codehaus.gmavenplus.mojo.AbstractCompileMojo.doCompile(AbstractCompileMojo.java:314)
[ERROR] at org.codehaus.gmavenplus.mojo.CompileMojo.execute(CompileMojo.java:70)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR] at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
[ERROR] Caused by: java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
[ERROR] at java.base/java.lang.ClassLoader.defineClass1(Native Method)
[ERROR] at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
[ERROR] at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:877)
[ERROR] at groovy.lang.GroovyClassLoader.defineClass(GroovyClassLoader.java:733)
[ERROR] at org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.evaluateExpression(StaticTypeCheckingSupport.java:2149)
[ERROR] at org.codehaus.groovy.transform.ASTTransformationCollectorCodeVisitor.lambda$findCollectedAnnotations$0(ASTTransformationCollectorCodeVisitor.java:186)
[ERROR] at java.base/java.util.Optional.map(Optional.java:265)
[ERROR] at org.codehaus.groovy.transform.ASTTransformationCollectorCodeVisitor.findCollectedAnnotations(ASTTransformationCollectorCodeVisitor.java:186)
[ERROR] at org.codehaus.groovy.transform.ASTTransformationCollectorCodeVisitor.visitAnnotations(ASTTransformationCollectorCodeVisitor.java:93)
[ERROR] at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:49)
[ERROR] at org.codehaus.groovy.transform.ASTTransformationCollectorCodeVisitor.visitClass(ASTTransformationCollectorCodeVisitor.java:77)
[ERROR] at org.codehaus.groovy.transform.ASTTransformationVisitor.lambda$addPhaseOperations$1(ASTTransformationVisitor.java:206)
[ERROR] at org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:942)
[ERROR] ... 33 more
[ERROR] Caused by: java.lang.ClassNotFoundException: groovy.lang.GroovyObject
[ERROR] at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
[ERROR] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
[ERROR] at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:869)
[ERROR] at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:979)
[ERROR] at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:967)
[ERROR] ... 46 more
[ERROR]
[ERROR] 1 error
[ERROR] -> [Help 1]

@yyi yyi changed the title update from 1.11.1 to 1.12.0 cla update from 1.11.1 to 1.12.0 error Dec 22, 2020
@keeganwitt
Copy link
Member

keeganwitt commented Dec 22, 2020

What includeClasspath do you have configured? Is this a multi-module build? Where is the Groovy dependency?

@yyi
Copy link
Author

yyi commented Dec 23, 2020

What includeClasspath do you have configured? Is this a multi-module build? Where is the Groovy dependency?

it's a spring boot single module project works with the gmavenplus version 1.11.1 and groovy version 3.0.7,but not with 1.12.0. if downgrade groovy to 2.5.14 ,it works again. That's a groovy bug?

springboot-groovy-demo.zip

@keeganwitt
Copy link
Member

Hmm, it's not immediately obvious to me what's going on here. I've got some holiday related stuff going on over the next week, but I will look into this as soon as I get back.

@keeganwitt
Copy link
Member

Interestingly, taking @Canonical off User.groovy makes the build pass. I'm not sure why offhand...

@yyi
Copy link
Author

yyi commented Dec 25, 2020

Hmm, it's not immediately obvious to me what's going on here. I've got some holiday related stuff going on over the next week, but I will look into this as soon as I get back.

thank you, have a nice holiday.

@keeganwitt
Copy link
Member

It looks like there's a usage somewhere in Groovy that is using the context classloader instead of the classloader passed into the constructor (or I missed passing it into a constructor somewhere, though I only found 1 place and that didn't fix it). Setting the context classloader (which I was doing in 1.11.1) seems to fix it. Now we know that it is, in fact, needed. Sorry for the breakage.

keeganwitt added a commit that referenced this issue Jan 3, 2021
Set context classloader (closes #186)
@keeganwitt keeganwitt self-assigned this Jan 3, 2021
@keeganwitt keeganwitt added this to the 1.12.1 milestone Jan 3, 2021
@keeganwitt keeganwitt added the Bug label Jan 3, 2021
keeganwitt added a commit that referenced this issue Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants