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

Fatal error: javax.crypto.JceSecurity.getCodeBase(Class) is reached at runtime. #2800

Closed
sendev1 opened this issue Aug 26, 2020 · 15 comments
Closed
Assignees

Comments

@sendev1
Copy link

sendev1 commented Aug 26, 2020

Describe the issue
Created native image for spring boot app.I has so many dependencies like CXF for soap calls. While running generated native image seeing this error

Fatal error: javax.crypto.JceSecurity.getCodeBase(Class) is reached at runtime. This should not happen. The contents of JceSecurity.verificationResults are computed and cached at image build time. Try enabling all security services with --enable-all-security-services.

JavaFrameAnchor dump:

  No anchors

TopFrame info:

  TotalFrameSize in CodeInfoTable 32

VMThreads info:

  VMThread 000000000096d720  STATUS_IN_NATIVE  java.lang.Thread@0x10e42ef8
  VMThread 000000000096d650  STATUS_IN_NATIVE  java.util.TimerThread@0x104ac4f0
  VMThread 000000000096dbf0  STATUS_IN_NATIVE  org.springframework.boot.web.embedded.tomcat.TomcatWebServer$1@0x1042dc18
  VMThread 0000000009054c10  STATUS_IN_NATIVE  org.apache.tomcat.util.threads.TaskThread@0x1042acc0
  VMThread 0000000009054b40  STATUS_IN_NATIVE  org.apache.tomcat.util.threads.TaskThread@0x10429a28
  VMThread 0000000009054a70  STATUS_IN_NATIVE  sun.misc.GC$Daemon@0xfe255b8
  VMThread 000000000096b160  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x9201170
  VMThread 000000000096b090  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x92012f0
  VMThread 000000000096afc0  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x9201418
  VMThread 0000000009054ee0  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x9201568
  VMThread 0000000009054e10  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x9201690
  VMThread 0000000009054d40  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x92017b8
  VMThread 00000000009627f0  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x92018e0
  VMThread 0000000000962720  STATUS_IN_NATIVE  java.lang.Thread@0x532af40
  VMThread 0000000000962650  STATUS_IN_JAVA (safepoints disabled)  java.lang.Thread@0x532ae90

VM Thread State for current thread 0000000000962650:

  0 (8 bytes): com.oracle.svm.jni.JNIThreadLocalEnvironment.jniFunctions = (bytes)
    0000000000962650: 00000000044b5010

  8 (32 bytes): com.oracle.svm.core.genscavenge.ThreadLocalAllocation.regularTLAB = (bytes)
    0000000000962658: 0000000011c00000 0000000011d00000
    0000000000962668: 0000000011c869d0 0000000000000000


  40 (8 bytes): com.oracle.svm.core.heap.NoAllocationVerifier.openVerifiers = (Object) null
  48 (8 bytes): com.oracle.svm.core.jdk.IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) java.util.SplittableRandom  0000000009202508
  56 (8 bytes): com.oracle.svm.core.snippets.ExceptionUnwind.currentException = (Object) null
  64 (8 bytes): com.oracle.svm.core.thread.JavaThreads.currentThread = (Object) java.lang.Thread  000000000532ae90
  72 (8 bytes): com.oracle.svm.core.thread.ThreadingSupportImpl.activeTimer = (Object) null
  80 (8 bytes): com.oracle.svm.jni.JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles  0000000009202530
  88 (8 bytes): com.oracle.svm.jni.JNIThreadLocalPendingException.pendingException = (Object) null
  96 (8 bytes): com.oracle.svm.jni.JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
  104 (8 bytes): com.oracle.svm.jni.JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  112 (8 bytes): com.oracle.svm.core.genscavenge.ThreadLocalAllocation.freeList = (Word) 0  0000000000000000
  120 (8 bytes): com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.stackBoundaryTL = (Word) 1  0000000000000001
  128 (8 bytes): com.oracle.svm.core.stack.JavaFrameAnchors.lastAnchor = (Word) 0  0000000000000000
  136 (8 bytes): com.oracle.svm.core.thread.VMThreads.IsolateTL = (Word) 42991616  0000000002900000
  144 (8 bytes): com.oracle.svm.core.thread.VMThreads.OSThreadHandleTL = (Word) 564  0000000000000234
  152 (8 bytes): com.oracle.svm.core.thread.VMThreads.OSThreadIdTL = (Word) 3328  0000000000000d00
  160 (8 bytes): com.oracle.svm.core.thread.VMThreads.nextTL = (Word) 0  0000000000000000
  168 (4 bytes): com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.yellowZoneStateTL = (int) -16843010  fefefefe
  172 (4 bytes): com.oracle.svm.core.snippets.ImplicitExceptions.implicitExceptionsAreFatal = (int) 0  00000000
  176 (4 bytes): com.oracle.svm.core.thread.Safepoint.safepointRequested = (int) 2134202846  7f3559de
  180 (4 bytes): com.oracle.svm.core.thread.ThreadingSupportImpl.currentPauseDepth = (int) 0  00000000
  184 (4 bytes): com.oracle.svm.core.thread.VMThreads$ActionOnTransitionToJavaSupport.actionTL = (int) 0  00000000
  188 (4 bytes): com.oracle.svm.core.thread.VMThreads$StatusSupport.safepointsDisabledTL = (int) 1  00000001
  192 (4 bytes): com.oracle.svm.core.thread.VMThreads$StatusSupport.statusTL = (int) 1  00000001

VMOperation dump:

  No VMOperation in progress

Dump Counters:


Raw Stacktrace:

  000000000054dd50: 0000000011c867a8 0000000011c867a8
  000000000054dd60: 0000000002900000 00007ff622ae9358
  000000000054dd70: 000000000ea9f660 0000000011c867a8
  000000000054dd80: 0000002a00000001 00007ff624c29f1c
  000000000054dd90: 000000001188b280 000000001188bb20
  000000000054dda0: 0000000001d9b260 0000000006009128
  000000000054ddb0: 00000000060090e8 0000000003eb1c30
  000000000054ddc0: 000000000ea9f660 00007ff624c1c486

Stacktrace Stage 0:

  SP 000000000054dd50 IP 00007ff622b1d736  FrameSize 32
  SP 000000000054dd70 IP 00007ff622ae9358  FrameSize 32
  SP 000000000054dd90 IP 00007ff624c29f1c  FrameSize 64
  SP 000000000054ddd0 IP 00007ff624c1c486  FrameSize 160
  SP 000000000054de70 IP 00007ff62450a48c  FrameSize 48
  SP 000000000054dea0 IP 00007ff624523b91  FrameSize 48
  SP 000000000054ded0 IP 00007ff622c5fc72  FrameSize 64
  SP 000000000054df10 IP 00007ff62479a769  FrameSize 48
  SP 000000000054df40 IP 00007ff626829836  FrameSize 64
  SP 000000000054df80 IP 00007ff62682a0b5  FrameSize 96
  SP 000000000054dfe0 IP 00007ff62682acb5  FrameSize 80
  SP 000000000054e030 IP 00007ff62682a8fb  FrameSize 64
  SP 000000000054e070 IP 00007ff626823239  FrameSize 64
  SP 000000000054e0b0 IP 00007ff62681e359  FrameSize 16
  SP 000000000054e0c0 IP 00007ff62681ed24  FrameSize 32
  SP 000000000054e0e0 IP 00007ff62681ec37  FrameSize 48
  SP 000000000054e110 IP 00007ff626820b94  FrameSize 112
  SP 000000000054e180 IP 00007ff626821046  FrameSize 80
  SP 000000000054e1d0 IP 00007ff626820299  FrameSize 80
  SP 000000000054e220 IP 00007ff62681ff39  FrameSize 80
  SP 000000000054e270 IP 00007ff62681fb1e  FrameSize 32
  SP 000000000054e290 IP 00007ff62681fad9  FrameSize 48
  SP 000000000054e2c0 IP 00007ff62680d9b4  FrameSize 64
  SP 000000000054e300 IP 00007ff62680feab  FrameSize 64
  SP 000000000054e340 IP 00007ff62681031f  FrameSize 32
  SP 000000000054e360 IP 00007ff626694aac  FrameSize 64
  SP 000000000054e3a0 IP 00007ff6266a117b  FrameSize 48
  SP 000000000054e3d0 IP 00007ff62669b5a3  FrameSize 128
  SP 000000000054e450 IP 00007ff626699996  FrameSize 112
  SP 000000000054e4c0 IP 00007ff6266b9b39  FrameSize 48
  SP 000000000054e4f0 IP 00007ff6266ad96e  FrameSize 16
  SP 000000000054e500 IP 00007ff6266f4bab  FrameSize 112
  SP 000000000054e570 IP 00007ff6266b09e5  FrameSize 144
  SP 000000000054e600 IP 00007ff626689340  FrameSize 16
  SP 000000000054e610 IP 00007ff6266e2e18  FrameSize 128
  SP 000000000054e690 IP 00007ff6266eda3c  FrameSize 80
  SP 000000000054e6e0 IP 00007ff6266d3e49  FrameSize 112
  SP 000000000054e750 IP 00007ff6266ccd64  FrameSize 288
  SP 000000000054e870 IP 00007ff6266c9829  FrameSize 240
  SP 000000000054e960 IP 00007ff62669876f  FrameSize 64
  SP 000000000054e9a0 IP 00007ff62669a950  FrameSize 96
  SP 000000000054ea00 IP 00007ff62669b653  FrameSize 128
  SP 000000000054ea80 IP 00007ff626699996  FrameSize 112
  SP 000000000054eaf0 IP 00007ff6266b9b39  FrameSize 48
  SP 000000000054eb20 IP 00007ff6266ad96e  FrameSize 16
  SP 000000000054eb30 IP 00007ff6266f4bab  FrameSize 112
  SP 000000000054eba0 IP 00007ff6266b09e5  FrameSize 144
  SP 000000000054ec30 IP 00007ff6266d05c2  FrameSize 288
  SP 000000000054ed50 IP 00007ff6266a169e  FrameSize 48
  SP 000000000054ed80 IP 00007ff62669a5e8  FrameSize 96
  SP 000000000054ede0 IP 00007ff62669b653  FrameSize 128
  SP 000000000054ee60 IP 00007ff626699996  FrameSize 112
  SP 000000000054eed0 IP 00007ff6266b9b39  FrameSize 48
  SP 000000000054ef00 IP 00007ff6266ad96e  FrameSize 16
  SP 000000000054ef10 IP 00007ff6266f4bab  FrameSize 112
  SP 000000000054ef80 IP 00007ff6266b09e5  FrameSize 144
  SP 000000000054f010 IP 00007ff626689340  FrameSize 16
  SP 000000000054f020 IP 00007ff6266e2e18  FrameSize 128
  SP 000000000054f0a0 IP 00007ff6266eda3c  FrameSize 80
  SP 000000000054f0f0 IP 00007ff6266d3e49  FrameSize 112
  SP 000000000054f160 IP 00007ff6266cdcab  FrameSize 288
  SP 000000000054f280 IP 00007ff6266c9829  FrameSize 240
  SP 000000000054f370 IP 00007ff62669876f  FrameSize 64
  SP 000000000054f3b0 IP 00007ff62669a950  FrameSize 96
  SP 000000000054f410 IP 00007ff62669b653  FrameSize 128
  SP 000000000054f490 IP 00007ff626699996  FrameSize 112
  SP 000000000054f500 IP 00007ff6266b9b39  FrameSize 48
  SP 000000000054f530 IP 00007ff6266ad96e  FrameSize 16
  SP 000000000054f540 IP 00007ff6266f4bab  FrameSize 112
  SP 000000000054f5b0 IP 00007ff6266b09e5  FrameSize 144
  SP 000000000054f640 IP 00007ff6266e975a  FrameSize 96
  SP 000000000054f6a0 IP 00007ff62695e461  FrameSize 64
  SP 000000000054f6e0 IP 00007ff62696416a  FrameSize 96
  SP 000000000054f740 IP 00007ff6268e9e71  FrameSize 32
  SP 000000000054f760 IP 00007ff626748bbb  FrameSize 48
  SP 000000000054f790 IP 00007ff626748c29  FrameSize 32
  SP 000000000054f7b0 IP 00007ff6267493b8  FrameSize 112
  SP 000000000054f820 IP 00007ff626749e73  FrameSize 32
  SP 000000000054f840 IP 00007ff624530cda  FrameSize 112
  SP 000000000054f8b0 IP 00007ff622ac8f8f  FrameSize 272

Stacktrace Stage 1:

  SP 000000000054dd50 IP 00007ff622b1d736  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054dd70 IP 00007ff622ae9358  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054dd90 IP 00007ff624c29f1c  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ddd0 IP 00007ff624c1c486  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054de70 IP 00007ff62450a48c  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054dea0 IP 00007ff624523b91  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ded0 IP 00007ff622c5fc72  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054df10 IP 00007ff62479a769  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054df40 IP 00007ff626829836  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054df80 IP 00007ff62682a0b5  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054dfe0 IP 00007ff62682acb5  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e030 IP 00007ff62682a8fb  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e070 IP 00007ff626823239  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e0b0 IP 00007ff62681e359  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e0c0 IP 00007ff62681ed24  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e0e0 IP 00007ff62681ec37  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e110 IP 00007ff626820b94  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e180 IP 00007ff626821046  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e1d0 IP 00007ff626820299  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e220 IP 00007ff62681ff39  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e270 IP 00007ff62681fb1e  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e290 IP 00007ff62681fad9  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e2c0 IP 00007ff62680d9b4  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e300 IP 00007ff62680feab  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e340 IP 00007ff62681031f  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e360 IP 00007ff626694aac  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e3a0 IP 00007ff6266a117b  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e3d0 IP 00007ff62669b5a3  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e450 IP 00007ff626699996  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e4c0 IP 00007ff6266b9b39  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e4f0 IP 00007ff6266ad96e  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e500 IP 00007ff6266f4bab  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e570 IP 00007ff6266b09e5  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e600 IP 00007ff626689340  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e610 IP 00007ff6266e2e18  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e690 IP 00007ff6266eda3c  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e6e0 IP 00007ff6266d3e49  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e750 IP 00007ff6266ccd64  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e870 IP 00007ff6266c9829  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e960 IP 00007ff62669876f  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054e9a0 IP 00007ff62669a950  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ea00 IP 00007ff62669b653  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ea80 IP 00007ff626699996  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054eaf0 IP 00007ff6266b9b39  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054eb20 IP 00007ff6266ad96e  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054eb30 IP 00007ff6266f4bab  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054eba0 IP 00007ff6266b09e5  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ec30 IP 00007ff6266d05c2  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ed50 IP 00007ff6266a169e  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ed80 IP 00007ff62669a5e8  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ede0 IP 00007ff62669b653  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ee60 IP 00007ff626699996  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054eed0 IP 00007ff6266b9b39  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ef00 IP 00007ff6266ad96e  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ef10 IP 00007ff6266f4bab  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054ef80 IP 00007ff6266b09e5  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f010 IP 00007ff626689340  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f020 IP 00007ff6266e2e18  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f0a0 IP 00007ff6266eda3c  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f0f0 IP 00007ff6266d3e49  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f160 IP 00007ff6266cdcab  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f280 IP 00007ff6266c9829  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f370 IP 00007ff62669876f  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f3b0 IP 00007ff62669a950  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f410 IP 00007ff62669b653  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f490 IP 00007ff626699996  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f500 IP 00007ff6266b9b39  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f530 IP 00007ff6266ad96e  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f540 IP 00007ff6266f4bab  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f5b0 IP 00007ff6266b09e5  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f640 IP 00007ff6266e975a  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f6a0 IP 00007ff62695e461  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f6e0 IP 00007ff62696416a  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f740 IP 00007ff6268e9e71  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f760 IP 00007ff626748bbb  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f790 IP 00007ff626748c29  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f7b0 IP 00007ff6267493b8  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f820 IP 00007ff626749e73  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f840 IP 00007ff624530cda  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code
  SP 000000000054f8b0 IP 00007ff622ac8f8f  com.oracle.svm.core.code.CodeInfo@0x5132ad0 name = image code

Stacktrace Stage 2:

  SP 000000000054dd50 IP 00007ff622b1d736  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:96)
  SP 000000000054dd50 IP 00007ff622b1d736  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:75)
  SP 000000000054dd70 IP 00007ff622ae9358  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:59)
  SP 000000000054dd70 IP 00007ff622ae9358  [image code] com.oracle.svm.core.jdk.JceSecurityUtil.shouldNotReach(SecuritySubstitutions.java:382)
  SP

Steps to reproduce the issue
Please include both build steps as well as run steps

  1. gradlew build
  2. native-image ^
    --no-server ^
    --no-fallback ^
    --initialize-at-build-time=com.sun.jmx.remote,org.apache.xerces.util.XMLChar,org.apache.xerces.xni.NamespaceContext ^
    --initialize-at-build-time=javax.xml.datatype.DatatypeFactory ^
    -H:Name=%ARTIFACT%-agent ^
    -H:+TraceClassInitialization ^
    -H:+RemoveSaturatedTypeFlows ^
    -H:+ReportExceptionStackTraces ^
    -H:DeadlockWatchdogInterval=10 ^
    -H:+DeadlockWatchdogExitOnTimeout ^
    -Dspring.native.remove-yaml-support=true ^
    -Dspring.xml.ignore=true ^
    -Dspring.spel.ignore=true ^
    -Dspring.native.remove-jmx-support=true ^
    -Dspring.native.verify=true ^
    -cp %CP% %MAINCLASS%

Describe GraalVM and your environment:

  • GraalVM version 20.3-dev
  • JDK major version: 8
  • OS: windows 10
  • Architecture: intel
@sendev1
Copy link
Author

sendev1 commented Aug 26, 2020

with --enable-all-security-services receiving this error

Fatal error: javax.crypto.JceSecurity.getCodeBase(Class) is reached at runtime. This should not happen. The contents of JceSecurity.verificationResults are computed and cached at image build time. Try enabling all security services with --enable-all-security-services.

JavaFrameAnchor dump:

  No anchors

TopFrame info:

  TotalFrameSize in CodeInfoTable 32

VMThreads info:

  VMThread 0000000001abbb70  STATUS_IN_NATIVE  java.lang.Thread@0x11b41fb0
  VMThread 0000000001abbaa0  STATUS_IN_NATIVE  java.util.TimerThread@0x111ab5c8
  VMThread 0000000001abdbf0  STATUS_IN_NATIVE  org.springframework.boot.web.embedded.tomcat.TomcatWebServer$1@0x1112ccd0
  VMThread 0000000001abe5f0  STATUS_IN_NATIVE  org.apache.tomcat.util.threads.TaskThread@0x11129d78
  VMThread 0000000001abe520  STATUS_IN_NATIVE  org.apache.tomcat.util.threads.TaskThread@0x11128ae0
  VMThread 0000000001abe450  STATUS_IN_NATIVE  sun.misc.GC$Daemon@0x10d24cc8
  VMThread 0000000001abb9d0  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x9f01170
  VMThread 0000000001abb630  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x9f01318
  VMThread 0000000001abb560  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x9f01440
  VMThread 0000000009dd4ee0  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x9f01568
  VMThread 0000000009dd4e10  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x9f01690
  VMThread 0000000009dd4a70  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x9f017b8
  VMThread 0000000001ab27f0  STATUS_IN_NATIVE  java.util.concurrent.ForkJoinWorkerThread@0x9f018e0
  VMThread 0000000001ab2720  STATUS_IN_NATIVE  java.lang.Thread@0x6022728
  VMThread 0000000001ab2650  STATUS_IN_JAVA (safepoints disabled)  java.lang.Thread@0x6022678

VM Thread State for current thread 0000000001ab2650:

  0 (8 bytes): com.oracle.svm.jni.JNIThreadLocalEnvironment.jniFunctions = (bytes)
    0000000001ab2650: 0000000005137010

  8 (32 bytes): com.oracle.svm.core.genscavenge.ThreadLocalAllocation.regularTLAB = (bytes)
    0000000001ab2658: 0000000012900000 0000000012a00000
    0000000001ab2668: 000000001296ae28 0000000000000000


  40 (8 bytes): com.oracle.svm.core.heap.NoAllocationVerifier.openVerifiers = (Object) null
  48 (8 bytes): com.oracle.svm.core.jdk.IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) java.util.SplittableRandom  0000000009f02508
  56 (8 bytes): com.oracle.svm.core.snippets.ExceptionUnwind.currentException = (Object) null
  64 (8 bytes): com.oracle.svm.core.thread.JavaThreads.currentThread = (Object) java.lang.Thread  0000000006022678
  72 (8 bytes): com.oracle.svm.core.thread.ThreadingSupportImpl.activeTimer = (Object) null
  80 (8 bytes): com.oracle.svm.jni.JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles  0000000009f02530
  88 (8 bytes): com.oracle.svm.jni.JNIThreadLocalPendingException.pendingException = (Object) null
  96 (8 bytes): com.oracle.svm.jni.JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
  104 (8 bytes): com.oracle.svm.jni.JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  112 (8 bytes): com.oracle.svm.core.genscavenge.ThreadLocalAllocation.freeList = (Word) 0  0000000000000000
  120 (8 bytes): com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.stackBoundaryTL = (Word) 1  0000000000000001
  128 (8 bytes): com.oracle.svm.core.stack.JavaFrameAnchors.lastAnchor = (Word) 0  0000000000000000
  136 (8 bytes): com.oracle.svm.core.thread.VMThreads.IsolateTL = (Word) 55574528  0000000003500000
  144 (8 bytes): com.oracle.svm.core.thread.VMThreads.OSThreadHandleTL = (Word) 532  0000000000000214
  152 (8 bytes): com.oracle.svm.core.thread.VMThreads.OSThreadIdTL = (Word) 5520  0000000000001590
  160 (8 bytes): com.oracle.svm.core.thread.VMThreads.nextTL = (Word) 0  0000000000000000
  168 (4 bytes): com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.yellowZoneStateTL = (int) -16843010  fefefefe
  172 (4 bytes): com.oracle.svm.core.snippets.ImplicitExceptions.implicitExceptionsAreFatal = (int) 0  00000000
  176 (4 bytes): com.oracle.svm.core.thread.Safepoint.safepointRequested = (int) 2134264229  7f3649a5
  180 (4 bytes): com.oracle.svm.core.thread.ThreadingSupportImpl.currentPauseDepth = (int) 0  00000000
  184 (4 bytes): com.oracle.svm.core.thread.VMThreads$ActionOnTransitionToJavaSupport.actionTL = (int) 0  00000000
  188 (4 bytes): com.oracle.svm.core.thread.VMThreads$StatusSupport.safepointsDisabledTL = (int) 1  00000001
  192 (4 bytes): com.oracle.svm.core.thread.VMThreads$StatusSupport.statusTL = (int) 1  00000001

VMOperation dump:

  No VMOperation in progress

Dump Counters:


Raw Stacktrace:

  00000000012fdd70: 000000001296ac00 000000001296ac00
  00000000012fdd80: 0000000003500000 00007ff676a79638
  00000000012fdd90: 000000000f79f0b8 000000001296ac00
  00000000012fdda0: 0000003400000001 00007ff678d0a15c
  00000000012fddb0: 000000001256f698 000000001256ff38
  00000000012fddc0: 0000000001e43be8 0000000006d5a7a8
  00000000012fddd0: 0000000006d5a768 0000000004b1e9e8
  00000000012fdde0: 000000000f79f0b8 00007ff678cfbf46

Stacktrace Stage 0:

  SP 00000000012fdd70 IP 00007ff676aade06  FrameSize 32
  SP 00000000012fdd90 IP 00007ff676a79638  FrameSize 32
  SP 00000000012fddb0 IP 00007ff678d0a15c  FrameSize 64
  SP 00000000012fddf0 IP 00007ff678cfbf46  FrameSize 160
  SP 00000000012fde90 IP 00007ff6785a55bc  FrameSize 48
  SP 00000000012fdec0 IP 00007ff6785becc1  FrameSize 48
  SP 00000000012fdef0 IP 00007ff676bf5aa2  FrameSize 64
  SP 00000000012fdf30 IP 00007ff6788366f9  FrameSize 48
  SP 00000000012fdf60 IP 00007ff67a9524b6  FrameSize 64
  SP 00000000012fdfa0 IP 00007ff67a952d35  FrameSize 96
  SP 00000000012fe000 IP 00007ff67a953935  FrameSize 80
  SP 00000000012fe050 IP 00007ff67a95357b  FrameSize 64
  SP 00000000012fe090 IP 00007ff67a94bebc  FrameSize 64
  SP 00000000012fe0d0 IP 00007ff67a946f99  FrameSize 16
  SP 00000000012fe0e0 IP 00007ff67a947964  FrameSize 32
  SP 00000000012fe100 IP 00007ff67a947877  FrameSize 48
  SP 00000000012fe130 IP 00007ff67a9497d4  FrameSize 112
  SP 00000000012fe1a0 IP 00007ff67a949c86  FrameSize 80
  SP 00000000012fe1f0 IP 00007ff67a948ed9  FrameSize 80
  SP 00000000012fe240 IP 00007ff67a948b79  FrameSize 80
  SP 00000000012fe290 IP 00007ff67a94875e  FrameSize 32
  SP 00000000012fe2b0 IP 00007ff67a948719  FrameSize 48
  SP 00000000012fe2e0 IP 00007ff67a9365f4  FrameSize 64
  SP 00000000012fe320 IP 00007ff67a938aeb  FrameSize 64
  SP 00000000012fe360 IP 00007ff67a938f5f  FrameSize 32
  SP 00000000012fe380 IP 00007ff67a7bd829  FrameSize 64
  SP 00000000012fe3c0 IP 00007ff67a7c9e8b  FrameSize 48
  SP 00000000012fe3f0 IP 00007ff67a7c42d3  FrameSize 128
  SP 00000000012fe470 IP 00007ff67a7c26e6  FrameSize 112
  SP 00000000012fe4e0 IP 00007ff67a7e2839  FrameSize 48
  SP 00000000012fe510 IP 00007ff67a7d666e  FrameSize 16
  SP 00000000012fe520 IP 00007ff67a81d8ab  FrameSize 112
  SP 00000000012fe590 IP 00007ff67a7d96e5  FrameSize 144
  SP 00000000012fe620 IP 00007ff67a7b2100  FrameSize 16
  SP 00000000012fe630 IP 00007ff67a80bb38  FrameSize 128
  SP 00000000012fe6b0 IP 00007ff67a81672c  FrameSize 80
  SP 00000000012fe700 IP 00007ff67a7fcb49  FrameSize 112
  SP 00000000012fe770 IP 00007ff67a7f5a64  FrameSize 288
  SP 00000000012fe890 IP 00007ff67a7f2529  FrameSize 240
  SP 00000000012fe980 IP 00007ff67a7c14bf  FrameSize 64
  SP 00000000012fe9c0 IP 00007ff67a7c36a0  FrameSize 96
  SP 00000000012fea20 IP 00007ff67a7c4383  FrameSize 128
  SP 00000000012feaa0 IP 00007ff67a7c26e6  FrameSize 112
  SP 00000000012feb10 IP 00007ff67a7e2839  FrameSize 48
  SP 00000000012feb40 IP 00007ff67a7d666e  FrameSize 16
  SP 00000000012feb50 IP 00007ff67a81d8ab  FrameSize 112
  SP 00000000012febc0 IP 00007ff67a7d96e5  FrameSize 144
  SP 00000000012fec50 IP 00007ff67a7f92c2  FrameSize 288
  SP 00000000012fed70 IP 00007ff67a7ca3ae  FrameSize 48
  SP 00000000012feda0 IP 00007ff67a7c3338  FrameSize 96
  SP 00000000012fee00 IP 00007ff67a7c4383  FrameSize 128
  SP 00000000012fee80 IP 00007ff67a7c26e6  FrameSize 112
  SP 00000000012feef0 IP 00007ff67a7e2839  FrameSize 48
  SP 00000000012fef20 IP 00007ff67a7d666e  FrameSize 16
  SP 00000000012fef30 IP 00007ff67a81d8ab  FrameSize 112
  SP 00000000012fefa0 IP 00007ff67a7d96e5  FrameSize 144
  SP 00000000012ff030 IP 00007ff67a7b2100  FrameSize 16
  SP 00000000012ff040 IP 00007ff67a80bb38  FrameSize 128
  SP 00000000012ff0c0 IP 00007ff67a81672c  FrameSize 80
  SP 00000000012ff110 IP 00007ff67a7fcb49  FrameSize 112
  SP 00000000012ff180 IP 00007ff67a7f69ab  FrameSize 288
  SP 00000000012ff2a0 IP 00007ff67a7f2529  FrameSize 240
  SP 00000000012ff390 IP 00007ff67a7c14bf  FrameSize 64
  SP 00000000012ff3d0 IP 00007ff67a7c36a0  FrameSize 96
  SP 00000000012ff430 IP 00007ff67a7c4383  FrameSize 128
  SP 00000000012ff4b0 IP 00007ff67a7c26e6  FrameSize 112
  SP 00000000012ff520 IP 00007ff67a7e2839  FrameSize 48
  SP 00000000012ff550 IP 00007ff67a7d666e  FrameSize 16
  SP 00000000012ff560 IP 00007ff67a81d8ab  FrameSize 112
  SP 00000000012ff5d0 IP 00007ff67a7d96e5  FrameSize 144
  SP 00000000012ff660 IP 00007ff67a81246a  FrameSize 96
  SP 00000000012ff6c0 IP 00007ff67aa87071  FrameSize 64
  SP 00000000012ff700 IP 00007ff67aa8cd7a  FrameSize 96
  SP 00000000012ff760 IP 00007ff67aa12a71  FrameSize 32
  SP 00000000012ff780 IP 00007ff67a87187b  FrameSize 48
  SP 00000000012ff7b0 IP 00007ff67a8718e9  FrameSize 32
  SP 00000000012ff7d0 IP 00007ff67a872078  FrameSize 112
  SP 00000000012ff840 IP 00007ff67a872b33  FrameSize 32
  SP 00000000012ff860 IP 00007ff6785cbe0a  FrameSize 112
  SP 00000000012ff8d0 IP 00007ff676a5926f  FrameSize 272

Stacktrace Stage 1:

  SP 00000000012fdd70 IP 00007ff676aade06  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fdd90 IP 00007ff676a79638  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fddb0 IP 00007ff678d0a15c  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fddf0 IP 00007ff678cfbf46  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fde90 IP 00007ff6785a55bc  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fdec0 IP 00007ff6785becc1  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fdef0 IP 00007ff676bf5aa2  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fdf30 IP 00007ff6788366f9  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fdf60 IP 00007ff67a9524b6  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fdfa0 IP 00007ff67a952d35  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe000 IP 00007ff67a953935  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe050 IP 00007ff67a95357b  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe090 IP 00007ff67a94bebc  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe0d0 IP 00007ff67a946f99  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe0e0 IP 00007ff67a947964  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe100 IP 00007ff67a947877  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe130 IP 00007ff67a9497d4  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe1a0 IP 00007ff67a949c86  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe1f0 IP 00007ff67a948ed9  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe240 IP 00007ff67a948b79  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe290 IP 00007ff67a94875e  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe2b0 IP 00007ff67a948719  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe2e0 IP 00007ff67a9365f4  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe320 IP 00007ff67a938aeb  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe360 IP 00007ff67a938f5f  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe380 IP 00007ff67a7bd829  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe3c0 IP 00007ff67a7c9e8b  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe3f0 IP 00007ff67a7c42d3  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe470 IP 00007ff67a7c26e6  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe4e0 IP 00007ff67a7e2839  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe510 IP 00007ff67a7d666e  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe520 IP 00007ff67a81d8ab  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe590 IP 00007ff67a7d96e5  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe620 IP 00007ff67a7b2100  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe630 IP 00007ff67a80bb38  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe6b0 IP 00007ff67a81672c  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe700 IP 00007ff67a7fcb49  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe770 IP 00007ff67a7f5a64  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe890 IP 00007ff67a7f2529  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe980 IP 00007ff67a7c14bf  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fe9c0 IP 00007ff67a7c36a0  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fea20 IP 00007ff67a7c4383  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012feaa0 IP 00007ff67a7c26e6  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012feb10 IP 00007ff67a7e2839  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012feb40 IP 00007ff67a7d666e  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012feb50 IP 00007ff67a81d8ab  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012febc0 IP 00007ff67a7d96e5  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fec50 IP 00007ff67a7f92c2  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fed70 IP 00007ff67a7ca3ae  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012feda0 IP 00007ff67a7c3338  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fee00 IP 00007ff67a7c4383  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fee80 IP 00007ff67a7c26e6  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012feef0 IP 00007ff67a7e2839  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fef20 IP 00007ff67a7d666e  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fef30 IP 00007ff67a81d8ab  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012fefa0 IP 00007ff67a7d96e5  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff030 IP 00007ff67a7b2100  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff040 IP 00007ff67a80bb38  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff0c0 IP 00007ff67a81672c  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff110 IP 00007ff67a7fcb49  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff180 IP 00007ff67a7f69ab  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff2a0 IP 00007ff67a7f2529  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff390 IP 00007ff67a7c14bf  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff3d0 IP 00007ff67a7c36a0  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff430 IP 00007ff67a7c4383  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff4b0 IP 00007ff67a7c26e6  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff520 IP 00007ff67a7e2839  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff550 IP 00007ff67a7d666e  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff560 IP 00007ff67a81d8ab  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff5d0 IP 00007ff67a7d96e5  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff660 IP 00007ff67a81246a  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff6c0 IP 00007ff67aa87071  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff700 IP 00007ff67aa8cd7a  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff760 IP 00007ff67aa12a71  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff780 IP 00007ff67a87187b  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff7b0 IP 00007ff67a8718e9  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff7d0 IP 00007ff67a872078  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff840 IP 00007ff67a872b33  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff860 IP 00007ff6785cbe0a  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code
  SP 00000000012ff8d0 IP 00007ff676a5926f  com.oracle.svm.core.code.CodeInfo@0x5e1f470 name = image code

Stacktrace Stage 2:

  SP 00000000012fdd70 IP 00007ff676aade06  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:96)
  SP 00000000012fdd70 IP 00007ff676aade06  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:75)
  SP 00000000012fdd90 IP 00007ff676a79638  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:59)
  SP 00000000012fdd90 IP 00007ff676a79638  [image code] com.oracle.svm.core.jdk.JceSecurityUtil.shouldNotReach(SecuritySubstitutions.java:382)
  SP 00000000012fddb0 IP 00007ff678d0a15c  [image code] javax.crypto.JceSecurity.getCodeBase(JceSecurity.java:346)
  SP 00000000012fddb0 IP 00007ff678d0a15c  [image code] javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:189)
  SP 00000000012fddf0 IP 00007ff678cfbf46  [image code] javax.crypto.JceSecurity.canUseProvider(JceSecurity.java:204)
  SP 00000000012fddf0 IP 00007ff678cfbf46  [image code] javax.crypto.Cipher.getInstance(Cipher.java:518)
  SP 00000000012fde90 IP 00007ff6785a55bc  [image code] com.vue.exam.plugin.CryptoUtil.<init>(CryptoUtil.java:66)
  SP 00000000012fdec0 IP 00007ff6785becc1  [image code] com.vue.exam.web.util.AESEncryptor.decrypt(AESEncryptor.java:125)
  SP 00000000012fdef0 IP 00007ff676bf5aa2  [image code] com.vue.exam.commons.http.ssl.AbstractKeystoreConfig.setPassword(AbstractKeystoreConfig.java:73)
  SP 00000000012fdef0 IP 00007ff676bf5aa2  [image code] com.oracle.svm.reflect.AbstractKeystoreConfig_setPassword_d92c9e3cf7e11702a5ac711dace61e1a43f4b48e.invoke(Unknown Source)
  SP 00000000012fdf30 IP 00007ff6788366f9  [image code] java.lang.reflect.Method.invoke(Method.java:498)
  SP 00000000012fdf60 IP 00007ff67a9524b6  [image code] org.springframework.boot.context.properties.bind.JavaBeanBinder$BeanProperty.setValue(JavaBeanBinder.java:348)
  SP 00000000012fdfa0 IP 00007ff67a952d35  [image code] org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:98)
  SP 00000000012fe000 IP 00007ff67a953935  [image code] org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:80)
  SP 00000000012fe050 IP 00007ff67a95357b  [image code] org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:56)
  SP 00000000012fe090 IP 00007ff67a94bebc  [image code] org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:451)
  SP 00000000012fe0d0 IP 00007ff67a946f99  [image code] org.springframework.boot.context.properties.bind.Binder$$Lambda$782cafb0c08942dac3f528803724cab8574ecfbc.get(Unknown Source)
  SP 00000000012fe0e0 IP 00007ff67a947964  [image code] org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:571)
  SP 00000000012fe100 IP 00007ff67a947877  [image code] org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:557)
  SP 00000000012fe130 IP 00007ff67a9497d4  [image code] org.springframework.boot.context.properties.bind.Binder$Context.access$300(Binder.java:512)
  SP 00000000012fe130 IP 00007ff67a9497d4  [image code] org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:449)
  SP 00000000012fe1a0 IP 00007ff67a949c86  [image code] org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:390)
  SP 00000000012fe1f0 IP 00007ff67a948ed9  [image code] org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:319)
  SP 00000000012fe240 IP 00007ff67a948b79  [image code] org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:308)
  SP 00000000012fe290 IP 00007ff67a94875e  [image code] org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:238)
  SP 00000000012fe2b0 IP 00007ff67a948719  [image code] org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:225)
  SP 00000000012fe2e0 IP 00007ff67a9365f4  [image code] org.springframework.boot.context.properties.ConfigurationPropertiesBinder.bind(ConfigurationPropertiesBinder.java:90)
  SP 00000000012fe320 IP 00007ff67a938aeb  [image code] org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:89)
  SP 00000000012fe360 IP 00007ff67a938f5f  [image code] org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:78)
  SP 00000000012fe380 IP 00007ff67a7bd829  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416)
  SP 00000000012fe3c0 IP 00007ff67a7c9e8b  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788)
  SP 00000000012fe3f0 IP 00007ff67a7c42d3  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
  SP 00000000012fe470 IP 00007ff67a7c26e6  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
  SP 00000000012fe4e0 IP 00007ff67a7e2839  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
  SP 00000000012fe510 IP 00007ff67a7d666e  [image code] org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$2c40051508af481f3e2b011afbd5800cdeae9fd3.getObject(Unknown Source)
  SP 00000000012fe520 IP 00007ff67a81d8ab  [image code] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
  SP 00000000012fe590 IP 00007ff67a7d96e5  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
  SP 00000000012fe620 IP 00007ff67a7b2100  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
  SP 00000000012fe620 IP 00007ff67a7b2100  [image code] org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
  SP 00000000012fe630 IP 00007ff67a80bb38  [image code] org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1304)
  SP 00000000012fe6b0 IP 00007ff67a81672c  [image code] org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1224)
  SP 00000000012fe700 IP 00007ff67a7fcb49  [image code] org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:884)
  SP 00000000012fe770 IP 00007ff67a7f5a64  [image code] org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
  SP 00000000012fe890 IP 00007ff67a7f2529  [image code] org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:227)
  SP 00000000012fe980 IP 00007ff67a7c14bf  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358)
  SP 00000000012fe9c0 IP 00007ff67a7c36a0  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204)
  SP 00000000012fea20 IP 00007ff67a7c4383  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
  SP 00000000012feaa0 IP 00007ff67a7c26e6  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
  SP 00000000012feb10 IP 00007ff67a7e2839  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
  SP 00000000012feb40 IP 00007ff67a7d666e  [image code] org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$2c40051508af481f3e2b011afbd5800cdeae9fd3.getObject(Unknown Source)
  SP 00000000012feb50 IP 00007ff67a81d8ab  [image code] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
  SP 00000000012febc0 IP 00007ff67a7d96e5  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
  SP 00000000012fec50 IP 00007ff67a7f92c2  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
  SP 00000000012fec50 IP 00007ff67a7f92c2  [image code] org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:408)
  SP 00000000012fed70 IP 00007ff67a7ca3ae  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)
  SP 00000000012feda0 IP 00007ff67a7c3338  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
  SP 00000000012fee00 IP 00007ff67a7c4383  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
  SP 00000000012fee80 IP 00007ff67a7c26e6  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
  SP 00000000012feef0 IP 00007ff67a7e2839  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
  SP 00000000012fef20 IP 00007ff67a7d666e  [image code] org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$2c40051508af481f3e2b011afbd5800cdeae9fd3.getObject(Unknown Source)
  SP 00000000012fef30 IP 00007ff67a81d8ab  [image code] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
  SP 00000000012fefa0 IP 00007ff67a7d96e5  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
  SP 00000000012ff030 IP 00007ff67a7b2100  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
  SP 00000000012ff030 IP 00007ff67a7b2100  [image code] org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
  SP 00000000012ff040 IP 00007ff67a80bb38  [image code] org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1304)
  SP 00000000012ff0c0 IP 00007ff67a81672c  [image code] org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1224)
  SP 00000000012ff110 IP 00007ff67a7fcb49  [image code] org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:884)
  SP 00000000012ff180 IP 00007ff67a7f69ab  [image code] org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
  SP 00000000012ff2a0 IP 00007ff67a7f2529  [image code] org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:227)
  SP 00000000012ff390 IP 00007ff67a7c14bf  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358)
  SP 00000000012ff3d0 IP 00007ff67a7c36a0  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204)
  SP 00000000012ff430 IP 00007ff67a7c4383  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
  SP 00000000012ff4b0 IP 00007ff67a7c26e6  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
  SP 00000000012ff520 IP 00007ff67a7e2839  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)

@munishchouhan
Copy link
Contributor

@sendev1
Please provide the code sample to reproduce this error

@munishchouhan munishchouhan self-assigned this Aug 27, 2020
@sendev1
Copy link
Author

sendev1 commented Aug 27, 2020

@mcraj017 here is the reproducer. https://github.com/sendev1/graalvm-samples.git. https://github.com/sendev1/graalvm-samples/blob/12617ca2300244a55cd5429d65c9a68941fa8cb0/src/main/java/com/demo/CryptoService.java#L29 This line is causing issue.

Stacktrace Stage 2:

  SP 00000000004ff9a0 IP 00007ff633193536  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:96)
  SP 00000000004ff9a0 IP 00007ff633193536  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:75)
  SP 00000000004ff9c0 IP 00007ff63315f238  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:59)
  SP 00000000004ff9c0 IP 00007ff63315f238  [image code] com.oracle.svm.core.jdk.JceSecurityUtil.shouldNotReach(SecuritySubstitutions.java:382)
  SP 00000000004ff9e0 IP 00007ff633ff6b6c  [image code] javax.crypto.JceSecurity.getCodeBase(JceSecurity.java:346)
  SP 00000000004ff9e0 IP 00007ff633ff6b6c  [image code] javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:189)
  SP 00000000004ffa20 IP 00007ff633fed9a6  [image code] javax.crypto.JceSecurity.canUseProvider(JceSecurity.java:204)
  SP 00000000004ffa20 IP 00007ff633fed9a6  [image code] javax.crypto.Cipher.getInstance(Cipher.java:518)
  SP 00000000004ffac0 IP 00007ff632e3b255  [image code] com.demo.CryptoService.<init>(CryptoService.java:29)
  SP 00000000004ffaf0 IP 00007ff632e3ba3e  [image code] com.demo.DemoApplication.main(DemoApplication.java:16)
  SP 00000000004ffb60 IP 00007ff63313efa6  [image code] com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:149)
  SP 00000000004ffb60 IP 00007ff63313efa6  [image code] com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:184)
  SP 00000000004ffb60 IP 00007ff63313efa6  [image code] com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(IsolateEnterStub.java:0)

@sendev1
Copy link
Author

sendev1 commented Aug 27, 2020

the generated exe can be found here https://github.com/sendev1/graalvm-samples/tree/master/native-image which is throwing Fatal error: javax.crypto.JceSecurity.getCodeBase(Class) is reached at runtime.

@sendev1
Copy link
Author

sendev1 commented Aug 28, 2020

Hi @mcraj017 , I found what is causing this issue and updated the reporducer.

I have found what is causing this issue. We have a static block in our spring config which inserts the java.security.Security Provider before spring framework initialize and in the same configuration class we use Cipher as well in one of the setter methods which is causing this issue Fatal error: javax.crypto.JceSecurity.getCodeBase(Class) is reached at runtime. This should not happen. The contents of JceSecurity.verificationResults are computed and cached at image build time. Try enabling all security services with --enable-all-security-services. even with --enable-all-security-services. The above sample runs fine when I run it as spring boot app but causing problem only when I create native image. Could you please advise an alternate way to insert the security Provider before spring framework starts.

@Configuration(proxyBeanMethods = false)
@ConfigurationProperties(prefix = "mail")
public class ConfigProperties {
    static {
        System.out.println("ConfigProperties static block!!!!!!!!!!!!!!!");
        EnvironmentConfigurer.configure();
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        try {
           // This one uses cipher
            String decryptedString = new CryptoService().decrypt(secret);
            this.secret = decryptedString;
            System.out.println("************Decrypted password:************** "+this.secret);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private String username;
    private String secret;
}
public class EnvironmentConfigurer {


    public static void configure() {

        try {
            System.out.println("Inside configure block!!!!!!!!!!!!!!!");
            loadProviderAt("org.bouncycastle.jce.provider.BouncyCastleProvider", 3);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static void loadProviderAt(String providerClassName, int position) throws Exception {
        System.out.println("Loading provider class..........");
        final Class providerClass = Class.forName(providerClassName);
        System.out.println("Create provider instance..........");
        final Provider provider = (Provider) providerClass.getConstructor().newInstance();
        System.out.println("Insert provider instance..........");
        final int finalPosition = Security.insertProviderAt(provider, position);
    }
}

Reproducer is here https://github.com/sendev1/graalvm-samples

@munishchouhan
Copy link
Contributor

@sendev1 Thanks for the reproducer, I will take a look and let you know
As soon as I have something for you

@sendev1
Copy link
Author

sendev1 commented Sep 1, 2020

any help on this would be appreciated

@dougxc dougxc assigned peter-hofer and unassigned dougxc Sep 15, 2020
@sendev1
Copy link
Author

sendev1 commented Sep 23, 2020

@mcraj017 any update on this issue please

@cstancu cstancu assigned cstancu and unassigned peter-hofer Sep 23, 2020
@sendev1
Copy link
Author

sendev1 commented Sep 23, 2020

@cstancu Looks like this line before using Cipher is causing problem when running native image Security.addProvider(new BouncyCastleFipsProvider());

Security.addProvider(new BouncyCastleFipsProvider());
        try {
            cipher = Cipher.getInstance(CIPHER_DESCRIPTOR);
            cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
            String decryptedString = cipher.decrypt(secret);
            this.secret = decryptedString;
            System.out.println("************Decrypted password:************** " + this.secret);
        } catch (Exception e) {
            e.printStackTrace();
        }

@sendev1
Copy link
Author

sendev1 commented Sep 23, 2020

@cstancu Looks like similar issue is reported #1152 way back in April 2019 but I could see any updates for this issue. Its blocking my work and I have been trying to figure out a solution for a month now. Kindly help me.

@cstancu
Copy link
Member

cstancu commented Oct 1, 2020

@sendev1 I reproduced the issue, thanks for the code! (I had to rewrite the script since I'm on Linux). I'll have a solution soon.

@cstancu
Copy link
Member

cstancu commented Oct 2, 2020

@sendev1 the problem here is that the BouncyCastle provider needs to be registered at build time. You can use the same config as here https://github.com/micronaut-projects/micronaut-oracle-cloud/pull/17/files. You'll need the feature

@AutomaticFeature
public class BouncyCastleFeature implements Feature {

    @Override
    public void afterRegistration(AfterRegistrationAccess access) {
        RuntimeClassInitialization.initializeAtBuildTime("org.bouncycastle");
        Security.addProvider(new BouncyCastleProvider());
    }

}

and --rerun-class-initialization-at-runtime=org.bouncycastle.jcajce.provider.drbg.DRBG$Default,org.bouncycastle.jcajce.provider.drbg.DRBG$NonceAndIV.

Admittedly the error message should be actionable and mention that you are trying to load a provider that was not registered at build time.

@cstancu
Copy link
Member

cstancu commented Oct 2, 2020

fdc9ba4 improves the error message when trying to load a provider that was not registered and verified at Native Image build time. That should make it easier to find the underlying issue for these kinds of errors in the future. The reason why providers need to be registered and verified at build time is that we don't have access to their code at run time. The configuration for BouncyCastle that I mentioned above will eventually be integrated into the BouncyCastle codebase.

@aalmiray
Copy link
Member

aalmiray commented Jan 5, 2022

Given that --rerun-class-initialization-at-runtime is deprecate since a while now, what's the correct way to get around this problem?

@zakkak
Copy link
Collaborator

zakkak commented Feb 10, 2022

@aalmiray you should be able to use RuntimeClassInitializationSupport.rerunInitialization in the feature, e.g.:

import com.oracle.svm.core.annotate.*;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.graalvm.nativeimage.ImageSingletons;
import org.graalvm.nativeimage.hosted.Feature;
import org.graalvm.nativeimage.hosted.RuntimeClassInitialization;
import org.graalvm.nativeimage.impl.RuntimeClassInitializationSupport;

import java.security.Security;

@AutomaticFeature
public class BouncyCastleFeature implements Feature {

    @Override
    public void afterRegistration(AfterRegistrationAccess access) {
        RuntimeClassInitialization.initializeAtBuildTime("org.bouncycastle");
        RuntimeClassInitializationSupport rci = ImageSingletons.lookup(RuntimeClassInitializationSupport.class);
        rci.rerunInitialization("org.bouncycastle.jcajce.provider.drbg.DRBG$Default", "");
        rci.rerunInitialization("org.bouncycastle.jcajce.provider.drbg.DRBG$NonceAndIV", "");
        Security.addProvider(new BouncyCastleProvider());
    }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants