quarkus: [native] 1.13.0.Final Fails To Build Native Image
Describe the bug
I got into a problem building native image after upgrading to 1.13.0 saying that it could not find some classes. I fixed it by following this comment and got into another problem that I haven’t found any solution. Here is the error log that I got
Error: Could not find target method: static io.netty.handler.ssl.SslContext io.quarkus.netty.runtime.graal.Target_io_netty_handler_ssl_SslContext.newServerContextInternal(io.netty.handler.ssl.SslProvider,java.security.Provider,java.security.cert.X509Certificate[],javax.net.ssl.TrustManagerFactory,java.security.cert.X509Certificate[],java.security.PrivateKey,java.lang.String,javax.net.ssl.KeyManagerFactory,java.lang.Iterable,io.netty.handler.ssl.CipherSuiteFilter,io.netty.handler.ssl.ApplicationProtocolConfig,long,long,io.netty.handler.ssl.ClientAuth,java.lang.String[],boolean,boolean,java.lang.String) throws javax.net.ssl.SSLException
com.oracle.svm.core.util.UserError$UserException: Could not find target method: static io.netty.handler.ssl.SslContext io.quarkus.netty.runtime.graal.Target_io_netty_handler_ssl_SslContext.newServerContextInternal(io.netty.handler.ssl.SslProvider,java.security.Provider,java.security.cert.X509Certificate[],javax.net.ssl.TrustManagerFactory,java.security.cert.X509Certificate[],java.security.PrivateKey,java.lang.String,javax.net.ssl.KeyManagerFactory,java.lang.Iterable,io.netty.handler.ssl.CipherSuiteFilter,io.netty.handler.ssl.ApplicationProtocolConfig,long,long,io.netty.handler.ssl.ClientAuth,java.lang.String[],boolean,boolean,java.lang.String) throws javax.net.ssl.SSLException
at com.oracle.svm.core.util.UserError.abort(UserError.java:68)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.findOriginalMethod(AnnotationSubstitutionProcessor.java:711)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleMethodInAliasClass(AnnotationSubstitutionProcessor.java:365)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleAliasClass(AnnotationSubstitutionProcessor.java:337)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleClass(AnnotationSubstitutionProcessor.java:309)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.init(AnnotationSubstitutionProcessor.java:265)
at com.oracle.svm.hosted.NativeImageGenerator.createDeclarativeSubstitutionProcessor(NativeImageGenerator.java:929)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:863)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:561)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:476)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Error: Image build request failed with exit status 1
This does not happen when I switch back to 1.11.6 and 1.12.x has this problem #15801.
Environment (please complete the following information):
Output of uname -a or ver
Darwin local 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64
Output of java -version
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9)
OpenJDK 64-Bit Server VM (build 11.0.10+9, mixed mode)
GraalVM version (if different from Java)
quay.io/quarkus/ubi-quarkus-native-image:21.0.0-java11
Quarkus version or git rev
1.13.0.Final
Build tool (ie. output of mvnw --version or gradlew --version)
------------------------------------------------------------
Gradle 6.8.3
------------------------------------------------------------
Build time: 2021-02-22 16:13:28 UTC
Revision: 9e26b4a9ebb910eaa1b8da8ff8575e514bc61c78
Kotlin: 1.4.20
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 11.0.10 (Oracle Corporation 11.0.10+9)
OS: Mac OS X 10.15.7 x86_64
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (12 by maintainers)
Commits related to this issue
- Remove --report-unsupported-elements-at-runtime As described in https://github.com/oracle/graal/issues/1725#issuecomment-547570158 this option is not meant to be used in production and under certain ... — committed to zakkak/aws-sdk-java-v2 by zakkak 3 years ago
- Remove --report-unsupported-elements-at-runtime As described in https://github.com/oracle/graal/issues/1725#issuecomment-547570158 this option is not meant to be used in production and under certain ... — committed to aws/aws-sdk-java-v2 by zakkak 3 years ago
From what I can see here, it’ll already be available as part of 21.1.
I was able to reproduce it with your sample project.
@zakkak do you have any idea what’s triggering this:
It looks like something is trying to delete
javax.security.jacc.PolicyContextExceptionwhen building the native image and that it’s not around but I scanned the Quarkus codebase and it doesn’t look like it’s us doing this.