Closed maxum2610 closed 9 months ago
Thanks for reporting this issue. As the native image and the agent have been heavily improved since 2020, I am closing this ticket assuming it has been fixed. If that is not the case, please test the latest release and share the new error log.
When I include java.awt.Toolkit in the reflection list like so: { "name" : "java.awt.Toolkit", "allDeclaredConstructors" : true, "allPublicConstructors" : true, "allDeclaredFields" : true, "allPublicFields" : true, "allDeclaredMethods" : true, "allPublicMethods" : true }
I get and error on class sun.awt.AWTAutoShutdown which does start a thread .
openjdk version "11.0.6" 2020-01-14 OpenJDK Runtime Environment GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07) OpenJDK 64-Bit Server VM GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07, mixed mode, sharing) OS is MacOS 10.14.5
Error: Unsupported features in 2 methods Detailed message: Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time. Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-build-time=. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: object sun.awt.AWTAutoShutdown
method sun.awt.AWTAutoShutdown.getInstance()
Call path from entry point to sun.awt.AWTAutoShutdown.getInstance():
at sun.awt.AWTAutoShutdown.getInstance(AWTAutoShutdown.java:132)
at java.awt.EventQueue.detachDispatchThread(EventQueue.java:1152)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:96)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:497)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
at com.oracle.svm.core.code.IsolateEnterStub.PosixJavaThreads_pthreadStartRoutine_e1f4a8c0039f8337338252cd8734f63a79b5e3df(generated:0)
Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time. Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-build-time=. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: object sun.java2d.opengl.OGLRenderQueue$QueueFlusher
object sun.java2d.opengl.OGLRenderQueue
field sun.java2d.opengl.OGLRenderQueue.theInstance
com.oracle.svm.core.util.UserError$UserException: Unsupported features in 2 methods Detailed message: Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time. Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-build-time=. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: object sun.awt.AWTAutoShutdown
method sun.awt.AWTAutoShutdown.getInstance()
Call path from entry point to sun.awt.AWTAutoShutdown.getInstance():
at sun.awt.AWTAutoShutdown.getInstance(AWTAutoShutdown.java:132)
at java.awt.EventQueue.detachDispatchThread(EventQueue.java:1152)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:96)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:497)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
at com.oracle.svm.core.code.IsolateEnterStub.PosixJavaThreads_pthreadStartRoutine_e1f4a8c0039f8337338252cd8734f63a79b5e3df(generated:0)
Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time. Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-build-time=. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: object sun.java2d.opengl.OGLRenderQueue$QueueFlusher
object sun.java2d.opengl.OGLRenderQueue
field sun.java2d.opengl.OGLRenderQueue.theInstance
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported features in 2 methods Detailed message: Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time. Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-build-time=. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: object sun.awt.AWTAutoShutdown
method sun.awt.AWTAutoShutdown.getInstance()
Call path from entry point to sun.awt.AWTAutoShutdown.getInstance():
at sun.awt.AWTAutoShutdown.getInstance(AWTAutoShutdown.java:132)
at java.awt.EventQueue.detachDispatchThread(EventQueue.java:1152)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:96)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:497)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
at com.oracle.svm.core.code.IsolateEnterStub.PosixJavaThreads_pthreadStartRoutine_e1f4a8c0039f8337338252cd8734f63a79b5e3df(generated:0)
Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image run time. Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-build-time=. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: object sun.java2d.opengl.OGLRenderQueue$QueueFlusher
object sun.java2d.opengl.OGLRenderQueue
field sun.java2d.opengl.OGLRenderQueue.theInstance
Error: Image build request failed with exit status 1 com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1 at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1482) at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1260) at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1222) at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1181) at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1665)