Closed
Description
Hello,
I am dealing with this issue for 2 days now and I don't understand if it's on my side or it's actually a bug.
Yesterday I managed to have a native-image out of a simple spring-boot aplication (hello world).
Today I added just a simple h2 database with a JPA feature to be able to manipulate some data.
I had this issue before but somehow it worked suddelny after playing with this two commands:
--rerun-class-initialization-at-runtime=sun.nio.ch.Iocp
or
--initialize-at-build-time=sun.nio.ch.Iocp
Now, after I added the h2/jpa features the error comes again an neither of these commands work anymore.
Here is the stack trace:
[com.springnative.demo.demoapplication:28968] (clinit): 2,903.05 ms, 6.69 GB
[com.springnative.demo.demoapplication:28968] (typeflow): 117,219.22 ms, 6.69 GB
[com.springnative.demo.demoapplication:28968] (objects): 178,872.05 ms, 6.69 GB
[com.springnative.demo.demoapplication:28968] (features): 19,354.82 ms, 6.69 GB
[com.springnative.demo.demoapplication:28968] analysis: 328,027.07 ms, 6.69 GB
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of sun.nio.ch.Iocp are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use --trace-object-instantiation=sun.nio.ch.Iocp.
Detailed message:
Trace:
at parsing sun.nio.ch.WindowsAsynchronousFileChannelImpl.open(WindowsAsynchronousFileChannelImpl.java:105)
Call path from entry point to sun.nio.ch.WindowsAsynchronousFileChannelImpl.open(FileDescriptor, boolean, boolean, ThreadPool):
at sun.nio.ch.WindowsAsynchronousFileChannelImpl.open(WindowsAsynchronousFileChannelImpl.java:104)
at sun.nio.fs.WindowsChannelFactory.newAsynchronousFileChannel(WindowsChannelFactory.java:208)
at sun.nio.fs.WindowsFileSystemProvider.newAsynchronousFileChannel(WindowsFileSystemProvider.java:140)
at java.nio.channels.AsynchronousFileChannel.open(AsynchronousFileChannel.java:248)
at java.nio.channels.AsynchronousFileChannel.open(AsynchronousFileChannel.java:301)
at org.h2.store.fs.FileAsync.<init>(FilePathAsync.java:121)
at org.h2.store.fs.FilePathAsync.open(FilePathAsync.java:53)
at org.h2.store.fs.FilePathSplit.open(FilePathSplit.java:128)
at org.h2.store.fs.FilePathSplit.newOutputStream(FilePathSplit.java:179)
at org.h2.store.fs.FileUtils.newOutputStream(FileUtils.java:239)
at org.h2.server.web.WebServer$TranslateThread.run(WebServer.java:853)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:519)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
at com.oracle.svm.core.code.IsolateEnterStub.WindowsJavaThreads_osThreadStartRoutine_4bc03aa26f8cdfc97ebd54050e8ae4bce1023851(generated:0)
Am I missing something?
If I have to post the pom.xml or any details please let me know.