0

I get the below error when I try to build a native image from an uberjar

Ran the below command:

./mvnw verify \
           -Pnative -Dquarkus.test.native-image-wait-time=300 \
           -Djavacpp.platform=${OSNAME}-x86_64

to build a native image from a uberjar.

Expected a final native image, instead got this error message:

Error: substitution target for io.quarkus.runtime.graal.QuarkusReplacement$GenMain is not loaded. Use field `onlyWith` in the `TargetClass` annotation to make substitution only active when needed.
com.oracle.svm.core.util.UserError$UserException: substitution target for io.quarkus.runtime.graal.QuarkusReplacement$GenMain is not loaded. Use field `onlyWith` in the `TargetClass` annotation to make substitution only active when needed.
at com.oracle.svm.core.util.UserError.abort(UserError.java:65)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.findTargetClass(AnnotationSubstitutionProcessor.java:823)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleClass(AnnotationSubstitutionProcessor.java:252)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.init(AnnotationSubstitutionProcessor.java:230)
at com.oracle.svm.hosted.NativeImageGenerator.createDeclarativeSubstitutionProcessor(NativeImageGenerator.java:875)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:824)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:524)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:444)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error: Image build request failed with exit status 1

Bit unsure if I missed out on adding any necessary Quarkus extensions.

Mani Sarkar
  • 115
  • 2
  • 9
  • 1
    Is this still an issue for you? – geoand Oct 14 '19 at 08:12
  • Just running the build again, will let you know asap. – Mani Sarkar Oct 15 '19 at 16:05
  • Okay I'll say it's gone away, I get these messages now, which is far more pleasing to the eyes: ```java [MLPMnist-1.0.0-runner:92101] classlist: 112,556.98 ms [MLPMnist-1.0.0-runner:92101] (cap): 7,899.96 ms [MLPMnist-1.0.0-runner:92101] setup: 14,896.51 ms SLF4J: Class path contains multiple SLF4J bindings. SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. ``` – Mani Sarkar Oct 15 '19 at 16:10
  • I think we can mark this as resolved. – Mani Sarkar Oct 15 '19 at 16:13
  • Good to hear :) – geoand Oct 15 '19 at 20:03

0 Answers0