-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Compilation error where classpath should exclude code path #523
Comments
@dsyer cannot spot the difference but looking at the stack trace I can see that |
Got same issue trying to build this spring boot app ./gradlew clean build nativeImage
Picked up JAVA_TOOL_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/5.0/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
> Task :nativeImage
Shutdown Server(pid: 9445, port: 44565)
Build on Server(pid: 10936, port: 46019)*
[graal:10936] classlist: 2,633.69 ms
[graal:10936] (cap): 632.25 ms
[graal:10936] setup: 1,353.65 ms
[graal:10936] analysis: 7,762.18 ms
fatal error: java.lang.NoClassDefFoundError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)
at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1005)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:420)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:278)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:396)
at com.oracle.svm.hosted.server.NativeImageBuildServer.executeCompilation(NativeImageBuildServer.java:391)
at com.oracle.svm.hosted.server.NativeImageBuildServer.lambda$processCommand$8(NativeImageBuildServer.java:328)
at com.oracle.svm.hosted.server.NativeImageBuildServer.withJVMContext(NativeImageBuildServer.java:409)
at com.oracle.svm.hosted.server.NativeImageBuildServer.processCommand(NativeImageBuildServer.java:325)
at com.oracle.svm.hosted.server.NativeImageBuildServer.processRequest(NativeImageBuildServer.java:269)
at com.oracle.svm.hosted.server.NativeImageBuildServer.lambda$serve$7(NativeImageBuildServer.java:229)
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.NoClassDefFoundError: groovy/lang/Closure
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at com.oracle.svm.hosted.ClassInitializationFeature.declaresDefaultMethods(ClassInitializationFeature.java:281)
at com.oracle.svm.hosted.ClassInitializationFeature.declaresDefaultMethods(ClassInitializationFeature.java:273)
at com.oracle.svm.hosted.ClassInitializationFeature.hasDefaultMethods(ClassInitializationFeature.java:269)
at com.oracle.svm.hosted.ClassInitializationFeature.buildClassInitializationInfo(ClassInitializationFeature.java:256)
at com.oracle.svm.hosted.ClassInitializationFeature.duringAnalysis(ClassInitializationFeature.java:198)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$doRun$7(NativeImageGenerator.java:713)
at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:63)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:713)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:403)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.ClassNotFoundException: groovy.lang.Closure
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 17 more
|
@mageddo your trace is different from the originally reported issue, but I think it was the same underlying problem. This issue was fixed recently (specifically in dd0bae3). The fix will be available in 1.0.0-rc12 coming out next week. In the meantime you can build from master. @dsyer the original issue should be fixed too. |
I will close this. Please reopen if it still occurs. |
This one is a bit strange because I can't reproduce it with a simple sample. If you try to compile a simple empty Spring Boot app it falls over like this:
The missing class is not actually needed at runtime, but we can't compile so we never get to prove it. The offending code in Spring Boot is here I think. Notice that the interface that depends on
groovy.lang.Closure
is never used ifisGroovyPresent()
is false.I tried to reproduce the problem with a simpler program and couldn't, so I'm out of ideas now. Maybe someone else can spot the different between the above code and this (which compiles and runs):
The text was updated successfully, but these errors were encountered: