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/06/30 13:18:42 UTC

[GitHub] [camel-quarkus] DouglasGo8 opened a new issue, #3891: Camel Quarkus + Azure Cosmos DB in Native Mode Issue

DouglasGo8 opened a new issue, #3891:
URL: https://github.com/apache/camel-quarkus/issues/3891

   Hello Guy, I'm working in a project that needs use Azure DB Cosmos using Quarkus with GraalVM, bellow my stack
   
   OS - MacOS Monterrey over M1 Max Machine arc64 (the same problem happens using Linux Containers)
   Maven Dependencies
   
   `<dependencyManagement>
       <dependencies>
         <dependency>
           <groupId>${quarkus.platform.group-id}</groupId>
           <artifactId>${quarkus.platform.artifact-id}</artifactId>
           <version>${quarkus.platform.version}</version>
           <type>pom</type>
           <scope>import</scope>
         </dependency>
   
   
         <dependency>
           <groupId>com.azure</groupId>
           <artifactId>azure-sdk-bom</artifactId>
           <version>1.2.2</version>
           <type>pom</type>
           <scope>import</scope>
           <!--
           <exclusions>
             <exclusion>
               <groupId>com.azure</groupId>
               <artifactId>azure-core-http-netty</artifactId>
             </exclusion>
           </exclusions>
           -->
         </dependency>
   
       </dependencies>
     </dependencyManagement>
   
     <dependencies>
       <!-- Azure SDK -->
       <!--
       <dependency>
         <groupId>com.azure</groupId>
         <artifactId>azure-cosmos</artifactId>
         <exclusions>
           <exclusion>
             <groupId>com.azure</groupId>
             <artifactId>azure-core-http-netty</artifactId>
           </exclusion>
         </exclusions>
       </dependency>
       -->
   
       <!-- Thanks for using https://jar-download.com -->
   
   
   
       <!--
       <dependency>
         <groupId>com.azure</groupId>
         <artifactId>azure-storage-blob</artifactId>
         <exclusions>
           <exclusion>
             <groupId>com.azure</groupId>
             <artifactId>azure-core-http-netty</artifactId>
           </exclusion>
         </exclusions>
       </dependency>
       -->
   
   
       <!-- Quarkus SDK -->
       <dependency>
         <groupId>io.quarkus</groupId>
         <artifactId>quarkus-funqy-knative-events</artifactId>
       </dependency>
       <dependency>
         <groupId>org.apache.camel.quarkus</groupId>
         <artifactId>camel-quarkus-azure-cosmosdb</artifactId>
         <version>2.9.0</version>
       </dependency>
       <!-- Misc -->
       <dependency>
         <groupId>org.projectlombok</groupId>
         <artifactId>lombok</artifactId>
         <version>1.18.24</version>
       </dependency>
       <!--  Test -->
       <dependency>
         <groupId>io.quarkus</groupId>
         <artifactId>quarkus-junit5</artifactId>
         <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>io.rest-assured</groupId>
         <artifactId>rest-assured</artifactId>
         <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>io.quarkus</groupId>
         <artifactId>quarkus-arc</artifactId>
       </dependency>
     </dependencies>`
   
   Command to try to generate the native bin
   
   # Only Mac OS Binary
   mvn clean -DskipTests package -Pnative -Dquarkus.native.native-image-xmx=4g
   
   # Only Linux arch64 Binary
   ./mvnw -DskipTests clean compile package -Pnative -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true -Dquarkus.native.builder-image=graalbasev17 -Dquarkus.native.native-image-xmx=5g
   
   The Error Output
   `
   [1/7] Initializing...                                                                                    (8.1s @ 0.23GB)
    Version info: 'GraalVM 22.1.0 Java 17 CE'
    C compiler: gcc (redhat, aarch64, 8.5.0)
    Garbage collector: Serial GC
    3 user-provided feature(s)
     - io.quarkus.runner.AutoFeature
     - io.quarkus.runtime.graal.DisableLoggingAutoFeature
     - io.quarkus.runtime.graal.ResourcesFeature
   13:15:49,044 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosClientBuilderAccessor...
   13:15:49,074 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting DirectConnectionConfigAccessor...
   13:15:49,085 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosBatchAccessor...
   13:15:49,095 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosBatchOperationResultAccessor...
   13:15:49,096 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosBatchRequestOptionsAccessor...
   13:15:49,097 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosBatchResponseAccessor...
   13:15:49,098 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosBulkExecutionOptionsAccessor...
   13:15:49,099 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosBulkExecutionThresholdsStateAccessor...
   13:15:49,099 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosBulkItemResponseAccessor...
   13:15:49,100 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosChangeFeedRequestOptionsAccessor...
   13:15:49,100 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosContainerPropertiesAccessor...
   13:15:49,101 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosItemRequestOptionsAccessor...
   13:15:49,101 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosItemResponseBuilderAccessor...
   13:15:49,102 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosPatchOperationsAccessor...
   13:15:49,103 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosQueryRequestOptionsAccessor...
   13:15:49,104 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting FeedResponseAccessor...
   13:15:49,104 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting PartitionKeyAccessor...
   13:15:49,109 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosClientAccessor...
   13:15:49,119 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosAsyncClientEncryptionKeyAccessor...
   13:15:49,120 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosAsyncContainerAccessor...
   13:15:49,121 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosAsyncDatabaseAccessor...
   13:15:49,139 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosDiagnosticsAccessor...
   13:15:49,140 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosExceptionAccessor...
   13:15:49,142 INFO  [com.azu.cos.imp.ImplementationBridgeHelpers] Setting CosmosPageFluxAccessor...
   13:15:50,090 INFO  [com.azu.cos.imp.dir.RntbdTransportClient] Using default Direct TCP options: azure.cosmos.directTcp.defaultOptions
   13:15:52,418 WARN  [com.azu.cos.imp.dir.rnt.RntbdLoopNativeDetector] Failed for native transport checking, will fall back to NIO: java.lang.ClassNotFoundException: io.netty.channel.epoll.Epoll
   	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
   	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
   	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
   	at java.base/java.lang.Class.forName0(Native Method)
   	at java.base/java.lang.Class.forName(Class.java:375)
   	at com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdLoopNativeDetector.<clinit>(RntbdLoopNativeDetector.java:23)
   	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
   	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1155)
   	at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.ensureClassInitialized(ConfigurableClassInitialization.java:183)
   	at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:653)
   	at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:136)
   	at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.shouldInitializeAtRuntime(ConfigurableClassInitialization.java:164)
   	at com.oracle.svm.hosted.SVMHost.isInitialized(SVMHost.java:286)
   	at com.oracle.graal.pointsto.meta.AnalysisType.isInitialized(AnalysisType.java:728)
   	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.maybeEagerlyInitialize(BytecodeParser.java:4258)
   	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1646)
   	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1639)
   	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5218)
   	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3358)
   	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3318)
   	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3163)
   	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
   	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
   	at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
   	at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:79)
   	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:236)
   	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.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
   	at com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:586)
   	at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:166)
   	at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:357)
   	at com.oracle.graal.pointsto.flow.MethodTypeFlow.createTypeFlow(MethodTypeFlow.java:301)
   	at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureTypeFlowCreated(MethodTypeFlow.java:290)
   	at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:111)
   	at com.oracle.graal.pointsto.DefaultAnalysisPolicy$DefaultSpecialInvokeTypeFlow.onObservedUpdate(DefaultAnalysisPolicy.java:393)
   	at com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:552)
   	at com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:631)
   	at com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
   	at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
   	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
   	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
   	at java.base/java.util.concurrent.ForkJoinPool.externalHelpQuiescePool(ForkJoinPool.java:2104)
   	at java.base/java.util.concurrent.ForkJoinPool.awaitQuiescence(ForkJoinPool.java:3321)
   	at com.oracle.graal.pointsto.util.CompletionExecutor.complete(CompletionExecutor.java:243)
   	at com.oracle.graal.pointsto.PointsToAnalysis.doTypeflow(PointsToAnalysis.java:688)
   	at com.oracle.graal.pointsto.PointsToAnalysis.finish(PointsToAnalysis.java:676)
   	at com.oracle.graal.pointsto.PointsToAnalysis.runAnalysis(PointsToAnalysis.java:732)
   	at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:723)
   	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:558)
   	at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:515)
   	at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:407)
   	at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:585)
   	at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
   	at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:615)
   
   [2/7] Performing analysis...  []                                                                         (8.1s @ 1.20GB)
      8,722 (92.43%) of  9,436 classes reachable
     12,026 (58.31%) of 20,624 fields reachable
     36,139 (78.98%) of 45,756 methods reachable
        572 classes,     0 fields, and     0 methods registered for reflection
   
   Fatal error: org.graalvm.compiler.debug.GraalError: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected.  To see how this object got instantiated use --trace-object-instantiation=java.util.Random. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
   	at com.oracle.graal.pointsto.util.AnalysisFuture.setException(AnalysisFuture.java:49)
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:269)
   	at com.oracle.graal.pointsto.util.AnalysisFuture.ensureDone(AnalysisFuture.java:63)
   	at com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$postTask$9(ImageHeapScanner.java:611)
   	at com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
   	at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
   	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
   	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
   	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
   	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
   	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
   	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
   Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected.  To see how this object got instantiated use --trace-object-instantiation=java.util.Random. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
   	at com.oracle.svm.hosted.image.DisallowedImageHeapObjectFeature.error(DisallowedImageHeapObjectFeature.java:173)
   	at com.oracle.svm.core.image.DisallowedImageHeapObjects.check(DisallowedImageHeapObjects.java:62)
   	at com.oracle.svm.hosted.image.DisallowedImageHeapObjectFeature.replacer(DisallowedImageHeapObjectFeature.java:149)
   	at com.oracle.graal.pointsto.meta.AnalysisUniverse.replaceObject(AnalysisUniverse.java:582)
   	at com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.replaceObject(AnalysisConstantReflectionProvider.java:257)
   	at com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.interceptValue(AnalysisConstantReflectionProvider.java:228)
   	at com.oracle.svm.hosted.heap.SVMImageHeapScanner.transformFieldValue(SVMImageHeapScanner.java:126)
   	at com.oracle.graal.pointsto.heap.ImageHeapScanner.onFieldValueReachable(ImageHeapScanner.java:331)
   	at com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$createImageHeapObject$3(ImageHeapScanner.java:272)
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   	... 10 more
   ------------------------------------------------------------------------------------------------------------------------
                           0.7s (3.9% of total time) in 19 GCs | Peak RSS: 2.36GB | CPU load: 3.37
   ========================================================================================================================
   Failed generating 'my-gdd-funqy-natived-1.0.0-SNAPSHOT-runner' after 17.3s.
   Error: Image build request failed with exit status 1
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD FAILURE
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time:  26.070 s
   [INFO] Finished at: 2022-06-30T10:15:52-03:00
   [INFO] ------------------------------------------------------------------------
   [ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.10.1.Final:build (default) on project my-gdd-funqy-natived: 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: io.quarkus.deployment.pkg.steps.NativeImageBuildStep$ImageGenerationFailureException: Image generation failed. Exit code: 1
   [ERROR] 	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:400)
   [ERROR] 	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:240)
   [ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
   [ERROR] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   [ERROR] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
   [ERROR] 	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:944)
   [ERROR] 	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
   [ERROR] 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
   [ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
   [ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
   [ERROR] 	at java.base/java.lang.Thread.run(Thread.java:833)
   [ERROR] 	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
   [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
   `


-- 
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.apache.org

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


[GitHub] [camel-quarkus] DouglasGo8 commented on issue #3891: Camel Quarkus + Azure Cosmos DB in Native Mode Issue Detected an instance of Random/SplittableRandom class

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

   Thanks for quick reply @ppalaga 


-- 
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] ppalaga commented on issue #3891: Camel Quarkus + Azure Cosmos DB in Native Mode Issue Detected an instance of Random/SplittableRandom class

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

   `camel-quarkus-azure-cosmosdb` is not supported in native mode yet -  see https://camel.apache.org/camel-quarkus/latest/reference/index.html and https://github.com/apache/camel-quarkus/issues/2648
   
   A contribution towards supporting it would be highly welcome. Please check our [Contributor guide](https://camel.apache.org/camel-quarkus/latest/contributor-guide/index.html) or feel free to ask specific questions if you are interested. 


-- 
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