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

native-image failing on helidon-quickstart-mp #2751

Closed
barchetta opened this issue Feb 10, 2021 · 1 comment · Fixed by #2753
Closed

native-image failing on helidon-quickstart-mp #2751

barchetta opened this issue Feb 10, 2021 · 1 comment · Fixed by #2753
Assignees
Labels
2.x Issues for 2.x version branch bug Something isn't working P1
Milestone

Comments

@barchetta
Copy link
Member

Environment Details

  • Helidon Version: 2.2.1-SNAPSHOT
  • Helidon MP
  • GraalVM version: graalvm-ce-java11-20.2.0
  • OS: MacOS and Linux

Problem Description

native-image build is failing for helidon-quickstart-mp (it works for SE):

[INFO] [helidon-quickstart-mp:14148]     (clinit):     900.53 ms,  4.51 GB
[INFO] [helidon-quickstart-mp:14148]   (typeflow):  28,645.66 ms,  4.51 GB
[INFO] [helidon-quickstart-mp:14148]    (objects):  41,128.92 ms,  4.51 GB
[INFO] [helidon-quickstart-mp:14148]   (features):   3,984.28 ms,  4.51 GB
[INFO] [helidon-quickstart-mp:14148]     analysis:  76,912.59 ms,  4.51 GB
[WARNING] Error: No instances of sun.security.provider.NativePRNG are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use -H:+TraceClassInitialization.
[WARNING] Detailed message:
[WARNING] Trace: Object was reached by
[WARNING] 	reading field java.security.SecureRandom.secureRandomSpi of
[WARNING] 		constant java.security.SecureRandom@2ad9a439 reached by
[WARNING] 	reading field sun.security.ssl.SSLContextImpl.secureRandom of
[WARNING] 		constant sun.security.ssl.SSLContextImpl$DefaultSSLContext@26f6fa75 reached by
[WARNING] 	reading field sun.security.ssl.SSLSocketFactoryImpl.context of
[WARNING] 		constant sun.security.ssl.SSLSocketFactoryImpl@1dafd2c reached by
[WARNING] 	reading field javax.net.ssl.HttpsURLConnection.defaultSSLSocketFactory
[WARNING]
[WARNING] com.oracle.svm.core.util.UserError$UserException: No instances of sun.security.provider.NativePRNG are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use -H:+TraceClassInitialization.
[WARNING] Detailed message:
[WARNING] Trace: Object was reached by
[WARNING] 	reading field java.security.SecureRandom.secureRandomSpi of
[WARNING] 		constant java.security.SecureRandom@2ad9a439 reached by
[WARNING] 	reading field sun.security.ssl.SSLContextImpl.secureRandom of
[WARNING] 		constant sun.security.ssl.SSLContextImpl$DefaultSSLContext@26f6fa75 reached by
[WARNING] 	reading field sun.security.ssl.SSLSocketFactoryImpl.context of
[WARNING] 		constant sun.security.ssl.SSLSocketFactoryImpl@1dafd2c reached by
[WARNING] 	reading field javax.net.ssl.HttpsURLConnection.defaultSSLSocketFactory
[WARNING]
[WARNING] 	at com.oracle.svm.core.util.UserError.abort(UserError.java:79)
[WARNING] 	at com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:217)
[WARNING] 	at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:765)
[WARNING] 	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:555)
[WARNING] 	at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:468)
[WARNING] 	at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
[WARNING] 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[WARNING] 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[WARNING] 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[WARNING] 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[WARNING] 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
[WARNING] Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of sun.security.provider.NativePRNG are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use -H:+TraceClassInitialization.
[WARNING] Detailed message:
[WARNING] Trace: Object was reached by
[WARNING] 	reading field java.security.SecureRandom.secureRandomSpi of
  ARNING] 		constant java.security.SecureRandom@2ad9a439 reached by
[WARNING] 	reading field sun.security.ssl.SSLContextImpl.secureRandom of
[WARNING] 		constant sun.security.ssl.SSLContextImpl$DefaultSSLContext@26f6fa75 reached by
[WARNING] 	reading field sun.security.ssl.SSLSocketFactoryImpl.context of
[WARNING] 		constant sun.security.ssl.SSLSocketFactoryImpl@1dafd2c reached by
[WARNING] 	reading field javax.net.ssl.HttpsURLConnection.defaultSSLSocketFactory
[WARNING]
[WARNING] 	at com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:126)
[WARNING] 	at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:762)
[WARNING] 	... 8 more
[WARNING] Error: Image build request failed with exit status 1

Steps to reproduce

  1. Run the archetype:
mvn -U archetype:generate -DinteractiveMode=false \
    -DarchetypeGroupId=io.helidon.archetypes \
    -DarchetypeArtifactId=helidon-quickstart-mp \
    -DarchetypeVersion=2.2.1-SNAPSHOT \
    -DgroupId=io.helidon.examples \
    -DartifactId=helidon-quickstart-mp \
    -Dpackage=io.helidon.examples.quickstart.mp
  1. Buidl the project with mvn clean package -Pnative-image
@barchetta barchetta added bug Something isn't working P1 2.x Issues for 2.x version branch labels Feb 10, 2021
@danielkec
Copy link
Contributor

Looks like its caused by Jersey bump up to 2.33 where is SSLSocketFactory initialized statically eclipse-ee4j/jersey@3996617#diff-8741cb483e9cee3d49210a3b736f154d915f4d850080b6bf8ba7a0552413540b

@tomas-langer tomas-langer self-assigned this Feb 10, 2021
@tomas-langer tomas-langer added this to the 2.2.1 milestone Feb 10, 2021
@m0mus m0mus added this to Backlog Aug 12, 2024
@m0mus m0mus moved this to Closed in Backlog Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issues for 2.x version branch bug Something isn't working P1
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants