You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/03/14 13:49:02 UTC

[GitHub] [camel-quarkus] josephearl opened a new issue #3617: Error building native executable with camel-quarkus-activemq

josephearl opened a new issue #3617:
URL: https://github.com/apache/camel-quarkus/issues/3617


   I have a Gradle/Java 11 project configured to build a native executable as follows:
   
   build.gradle:
   ```
   quarkusBuild {
       nativeArgs {
           containerBuild = true
           builderImage = "quay.io/quarkus/ubi-quarkus-native-image:22.0.0-java11"
       }
   }
   ```
   
   application.properties:
   ```
   quarkus.package.type=native
   ```
   
   As soon as I add the following to my build.gradle to use camel-quarkus-activemq:
   
   ```
   implementation enforcedPlatform("${quarkusPlatformGroupId}:quarkus-camel-bom:${quarkusPlatformVersion}")
   implementation 'org.apache.camel.quarkus:camel-quarkus-activemq'
   ```
   
   then `./gradlew assemble` starts to fail when building the native image with:
   
   ```
   > Task :quarkusBuild
   building quarkus jar
   
   22.0.0-java11: Pulling from quarkus/ubi-quarkus-native-image
   Digest: sha256:9c107acc8f6d05515f5da9e4738125bb40360b5aa093f4e1eea4475042f3733e
   Status: Image is up to date for quay.io/quarkus/ubi-quarkus-native-image:22.0.0-java11
   quay.io/quarkus/ubi-quarkus-native-image:22.0.0-java11
   ========================================================================================================================
   GraalVM Native Image: Generating 'code-with-quarkus-1.0.0-SNAPSHOT-runner'...
   ========================================================================================================================
   [1/7] Initializing...
                                                                                      (59.3s @ 0.09GB)
   Error: Cannot find org.springframework.beans.BeanUtils$KotlinDelegate.findPrimaryConstructor, org.springframework.beans.BeanUtils$KotlinDelegate can not be loaded, due to kotlin/reflect/KCallable not being available in the classpath. Are you missing a dependency in your classpath?
   com.oracle.svm.core.util.UserError$UserException: Cannot find org.springframework.beans.BeanUtils$KotlinDelegate.findPrimaryConstructor, org.springframework.beans.BeanUtils$KotlinDelegate can not be loaded, due to kotlin/reflect/KCallable not being available in the classpath. Are you missing a dependency in your classpath?
           at com.oracle.svm.core.util.UserError.abort(UserError.java:73)
   ------------------------------------------------------------------------------------------------------------------------
           at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.findOriginalMethod(AnnotationSubstitutionProcessor.java:753)
           at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleMethodInAliasClass(AnnotationSubstitutionProcessor.java:368)
           at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleAliasClass(AnnotationSubstitutionProcessor.java:340)
           at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleClass(AnnotationSubstitutionProcessor.java:310)
           at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.init(AnnotationSubstitutionProcessor.java:266)
           at com.oracle.svm.hosted.NativeImageGenerator.createAnnotationSubstitutionProcessor(NativeImageGenerator.java:889)
           at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:816)
           at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:534)
           at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:494)
           at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:426)
           at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:587)
           at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:126)
           at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:617)
                           0.8s (2.4% of total time) in 14 GCs | Peak RSS: 0.81GB | CPU load: 1.49
   ------------------------------------------------------------------------------------------------------------------------
   Produced artifacts:
    /project/code-with-quarkus-1.0.0-SNAPSHOT-runner.build_artifacts.txt
   ========================================================================================================================
   Failed generating 'code-with-quarkus-1.0.0-SNAPSHOT-runner' after 31.5s.
   Error: Image build request failed with exit status 1
   
   > Task :quarkusBuild FAILED
   
   FAILURE: Build failed with an exception.
   
   * What went wrong:
   Execution failed for task ':quarkusBuild'.
   > io.quarkus.builder.BuildException: Build failure: Build failed due to errors
           [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: io.quarkus.deployment.pkg.steps.NativeImageBuildStep$ImageGenerationFailureException: Image generation failed. Exit code: 1
           at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:391)
           at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:232)
           at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.base/java.lang.reflect.Method.invoke(Method.java:566)
           at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:882)
           at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
           at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
           at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
           at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
           at java.base/java.lang.Thread.run(Thread.java:834)
           at org.jboss.threads.JBossThread.run(JBossThread.java:501)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton closed issue #3617: Error building native executable with camel-quarkus-activemq

Posted by GitBox <gi...@apache.org>.
jamesnetherton closed issue #3617:
URL: https://github.com/apache/camel-quarkus/issues/3617


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on issue #3617: Error building native executable with camel-quarkus-activemq

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #3617:
URL: https://github.com/apache/camel-quarkus/issues/3617#issuecomment-1066852629


   There are a set of workarounds in place to avoid the need for Kotlin to be on the runtime classpath for native compilation:
   
   https://github.com/apache/camel-quarkus/blob/main/extensions-support/spring/deployment/src/main/java/org/apache/camel/quarkus/support/spring/deployment/SpringKotlinProcessor.java
   
   Maybe this is not working with Gradle. E.g maybe those Kotlin classes are some how resolvable at build time but not at runtime.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] josephearl commented on issue #3617: Error building native executable with camel-quarkus-activemq

Posted by GitBox <gi...@apache.org>.
josephearl commented on issue #3617:
URL: https://github.com/apache/camel-quarkus/issues/3617#issuecomment-1067744022


   @jamesnetherton thanks, understood. I have added that dependency and it did fix the native build


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] josephearl commented on issue #3617: Error building native executable with camel-quarkus-activemq

Posted by GitBox <gi...@apache.org>.
josephearl commented on issue #3617:
URL: https://github.com/apache/camel-quarkus/issues/3617#issuecomment-1067728712


   I'm not using Kotlin at all so wouldn't have thought adding a kotlin dependency would be needed?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on issue #3617: Error building native executable with camel-quarkus-activemq

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #3617:
URL: https://github.com/apache/camel-quarkus/issues/3617#issuecomment-1067738556


   > I'm not using Kotlin at all so wouldn't have thought adding a kotlin dependency would be needed?
   
   It isn't. But in this case we need to work around the Gradle issue I mentioned & satisfy the native compiler. So it could serve as a temporary workaround until the root cause is fixed properly. Otherwise the alternative is to switch to building with Maven. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on issue #3617: Error building native executable with camel-quarkus-activemq

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #3617:
URL: https://github.com/apache/camel-quarkus/issues/3617#issuecomment-1066856029


   You could try adding a dependency for `io.quarkus:quarkus-kotlin` to see if that fixes things.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org