Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2084

Building image from Quarkus/OptaPlanner project

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • None
    • None
    • None
    • None
    • Hide

      Run the dockerfile as it is in the attatchments.

      Show
      Run the dockerfile as it is in the attatchments.
    • NEW
    • NEW

      I've been developing a project using Quarkus and Optaplanner, using the Optaplanner quick start documentation as a guide, and now that it's finished the goal it's to create a docker image from it. 

      The problem is that when I build the dockerfile to create the image i get the following error:

      Error: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.ClassLoader.defineClass1(ClassLoader, String, byte[], int, int, ProtectionDomain, String) is reachable
      {{ To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.}}
      {{ Detailed message:}}
      {{ Trace:}}
      {{ at parsing java.lang.ClassLoader.defineClass(ClassLoader.java:1017)}}
      {{ Call path from entry point to java.lang.ClassLoader.defineClass(String, byte[], int, int, ProtectionDomain):}}
      {{ at java.lang.ClassLoader.defineClass(ClassLoader.java:1015)}}
      {{ at org.drools.dynamic.DynamicComponentsSupplier$DefaultByteArrayClassLoader.defineClass(DynamicComponentsSupplier.java:49)}}
      {{ at org.drools.core.base.ClassFieldAccessorFactory.getClassFieldWriter(ClassFieldAccessorFactory.java:194)}}
      {{ at org.drools.core.base.ClassFieldAccessorCache$CacheEntry.getWriteAccessor(ClassFieldAccessorCache.java:204)}}
      {{ at org.drools.core.base.ClassFieldAccessorCache.getWriteAcessor(ClassFieldAccessorCache.java:115)}}
      {{ at org.drools.core.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:299)}}
      {{ at org.drools.core.base.ClassFieldAccessorStore.merge(ClassFieldAccessorStore.java:237)}}
      {{ at org.drools.core.impl.KnowledgeBaseImpl.internalAddPackages(KnowledgeBaseImpl.java:902)}}
      {{ at org.drools.core.impl.KnowledgeBaseImpl.lambda$addPackages$2(KnowledgeBaseImpl.java:729)}}
      {{ at org.drools.core.impl.KnowledgeBaseImpl$$Lambda$907/0x00000007c291b840.run(Unknown Source)}}
      {{ at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:125)}}
      {{ at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:75)}}
      {{ at com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:141)}}
      {{ at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:184)}}
      {{ at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)}}com.oracle.svm.core.util.UserError$UserException: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.ClassLoader.defineClass1(ClassLoader, String, byte[], int, int, ProtectionDomain, String) is reachable
      {{ To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.}}
      {{ Detailed message:}}
      {{ Trace:}}
      {{ at parsing java.lang.ClassLoader.defineClass(ClassLoader.java:1017)}}
      {{ Call path from entry point to java.lang.ClassLoader.defineClass(String, byte[], int, int, ProtectionDomain):}}
      {{ at java.lang.ClassLoader.defineClass(ClassLoader.java:1015)}}
      {{ at org.drools.dynamic.DynamicComponentsSupplier$DefaultByteArrayClassLoader.defineClass(DynamicComponentsSupplier.java:49)}}
      {{ at org.drools.core.base.ClassFieldAccessorFactory.getClassFieldWriter(ClassFieldAccessorFactory.java:194)}}
      {{ at org.drools.core.base.ClassFieldAccessorCache$CacheEntry.getWriteAccessor(ClassFieldAccessorCache.java:204)}}
      {{ at org.drools.core.base.ClassFieldAccessorCache.getWriteAcessor(ClassFieldAccessorCache.java:115)}}
      {{ at org.drools.core.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:299)}}
      {{ at org.drools.core.base.ClassFieldAccessorStore.merge(ClassFieldAccessorStore.java:237)}}
      {{ at org.drools.core.impl.KnowledgeBaseImpl.internalAddPackages(KnowledgeBaseImpl.java:902)}}
      {{ at org.drools.core.impl.KnowledgeBaseImpl.lambda$addPackages$2(KnowledgeBaseImpl.java:729)}}
      {{ at org.drools.core.impl.KnowledgeBaseImpl$$Lambda$907/0x00000007c291b840.run(Unknown Source)}}
      {{ at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:125)}}
      {{ at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:75)}}
      {{ at com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:141)}}
      {{ at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:184)}}
      {{ at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)}}at com.oracle.svm.core.util.UserError.abort(UserError.java:79)
      {{ at com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:217)}}
      {{ at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:753)}}
      {{ at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:538)}}
      {{ at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:451)}}
      {{ 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:177)}}
      {{ Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.ClassLoader.defineClass1(ClassLoader, String, byte[], int, int, ProtectionDomain, String) is reachable}}
      {{ To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.}}
      {{ Detailed message:}}
      {{ Trace:}}
      {{ at parsing java.lang.ClassLoader.defineClass(ClassLoader.java:1017)}}
      {{ Call path from entry point to java.lang.ClassLoader.defineClass(String, byte[], int, int, ProtectionDomain):}}
      {{ at java.lang.ClassLoader.defineClass(ClassLoader.java:1015)}}
      {{ at org.drools.dynamic.DynamicComponentsSupplier$DefaultByteArrayClassLoader.defineClass(DynamicComponentsSupplier.java:49)}}
      {{ at org.drools.core.base.ClassFieldAccessorFactory.getClassFieldWriter(ClassFieldAccessorFactory.java:194)}}
      {{ at org.drools.core.base.ClassFieldAccessorCache$CacheEntry.getWriteAccessor(ClassFieldAccessorCache.java:204)}}
      {{ at org.drools.core.base.ClassFieldAccessorCache.getWriteAcessor(ClassFieldAccessorCache.java:115)}}
      {{ at org.drools.core.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:299)}}
      {{ at org.drools.core.base.ClassFieldAccessorStore.merge(ClassFieldAccessorStore.java:237)}}
      {{ at org.drools.core.impl.KnowledgeBaseImpl.internalAddPackages(KnowledgeBaseImpl.java:902)}}
      {{ at org.drools.core.impl.KnowledgeBaseImpl.lambda$addPackages$2(KnowledgeBaseImpl.java:729)}}
      {{ at org.drools.core.impl.KnowledgeBaseImpl$$Lambda$907/0x00000007c291b840.run(Unknown Source)}}
      {{ at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:125)}}
      {{ at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:75)}}
      {{ at com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:141)}}
      {{ at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:184)}}
      {{ at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)}}at com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:126)
      {{ at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:750)}}
      {{ ... 8 more}}
      {{ Caused by: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.ClassLoader.defineClass1(ClassLoader, String, byte[], int, int, ProtectionDomain, String) is reachable}}
      {{ To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.}}
      {{ at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.lookup(AnnotationSubstitutionProcessor.java:183)}}
      {{ at com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:128)}}
      {{ at com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:128)}}
      {{ at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:397)}}
      {{ at com.oracle.graal.pointsto.infrastructure.WrappedConstantPool.lookupMethod(WrappedConstantPool.java:116)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.lookupMethodInPool(BytecodeParser.java:4323)}}
      {{ at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.lookupMethodInPool(SharedGraphBuilderPhase.java:107)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.lookupMethod(BytecodeParser.java:4317)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1659)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5340)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3423)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3230)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1088)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:982)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:214)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)}}
      {{ at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)}}
      {{ at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:225)}}
      {{ at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:352)}}
      {{ at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:322)}}
      {{ at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:311)}}
      {{ at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:112)}}
      {{ at com.oracle.graal.pointsto.DefaultAnalysisPolicy$DefaultSpecialInvokeTypeFlow.onObservedUpdate(DefaultAnalysisPolicy.java:373)}}
      {{ at com.oracle.graal.pointsto.flow.TypeFlow.notifyObservers(TypeFlow.java:470)}}
      {{ at com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:542)}}
      {{ at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:530)}}
      {{ at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)}}
      {{ at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)}}
      {{ ... 5 more}}
      {{ Error: Image build request failed with exit status 1}}
      {{ [INFO] ------------------------------------------------------------------------}}
      {{ [INFO] BUILD FAILURE}}
      {{ [INFO] ------------------------------------------------------------------------}}
      {{ [INFO] Total time: 08:42 min}}
      {{ [INFO] Finished at: 2020-07-20T16:03:57Z}}
      {{ [INFO] ------------------------------------------------------------------------}}
      {{ [ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.4.2.Final:build (default) on project optaplanner: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors}}
      {{ [ERROR] [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image}}
      {{ [ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:353)}}
      {{ [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)}}
      {{ [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)}}
      {{ [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)}}
      {{ [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)}}
      {{ [ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:931)}}
      {{ [ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277)}}
      {{ [ERROR] at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)}}
      {{ [ERROR] at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)}}
      {{ [ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)}}
      {{ [ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)}}
      {{ [ERROR] at java.base/java.lang.Thread.run(Thread.java:834)}}
      {{ [ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:479)}}
      {{ [ERROR] Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 1}}
      {{ [ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:369)}}
      {{ [ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:339)}}
      {{ [ERROR] ... 12 more}}
      {{ [ERROR] -> [Help 1]}}
      {{ [ERROR]}}
      {{ [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.}}
      {{ [ERROR] Re-run Maven using the -X switch to enable full debug logging.}}
      {{ [ERROR]}}
      {{ [ERROR] For more information about the errors and possible solutions, please read the following articles:}}
      {{ [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException}}
      {{ The command '/bin/sh -c mvn -f /usr/src/app/pom.xml -Pnative clean package' returned a non-zero code: 1}}

       

      I'll attach the dockerfile and the pom.xml file.

        1. pom.xml
          5 kB
        2. Dockerfile
          0.8 kB

              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              ricardo.j.cardoso Ricardo Cardoso (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: