zakkak opened a new issue, #6291: URL: https://github.com/apache/camel-quarkus/issues/6291
### Bug description ## Description Building a project with both `camel-quarkus-syslog` and `quarkus-jdbc-oracle` as dependencies results in build failures in native-mode. The output looks like this: ``` Fatal error: org.graalvm.compiler.debug.GraalError: org.graalvm.compiler.debug.GraalError: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected a MBean server in the image heap. This is currently not supported, but could be changed in the future. Management beans are registered in many global caches that would need to be cleared and properly re-built at image build time. Class of disallowed object: com.sun.jmx.mbeanserver.JmxMBeanServer Try to avoid initializing the class that stores a MBean server or a MBean in a static field The culprit object has been instantiated by the 'oracle.jdbc.driver.OracleDriver' class initializer with the following trace: at com.sun.jmx.mbeanserver.JmxMBeanServer.<init>(JmxMBeanServer.java:225) at com.sun.jmx.mbeanserver.JmxMBeanServer.newMBeanServer(JmxMBeanServer.java:1437) at javax.management.MBeanServerBuilder.newMBeanServer(MBeanServerBuilder.java:110) at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:329) at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:231) at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:192) at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:487) at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:454) at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:293) at java.security.AccessController.executePrivileged(AccessController.java:778) at java.security.AccessController.doPrivileged(AccessController.java:319) at oracle.jdbc.driver.OracleDriver.<clinit>(OracleDriver.java:291) 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 org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisFuture.setException(AnalysisFuture.java:49) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:322) at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisFuture.ensureDone(AnalysisFuture.java:63) at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapInstance.readFieldValue(ImageHeapInstance.java:110) at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.onObjectReachable(ImageHeapScanner.java:472) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.heap.SVMImageHeapScanner.onObjectReachable(SVMImageHeapScanner.java:156) at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$markReachable$5(ImageHeapScanner.java:452) at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$postTask$14(ImageHeapScanner.java:695) at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:187) at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:171) at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1423) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ... ``` ## Reproducer ``` wget "https://code.quarkus.io/d?e=jdbc-oracle&e=org.apache.camel.quarkus%3Acamel-quarkus-syslog&cn=code.quarkus.io" -O code.zip unzip code.zip cd code-with-quarkus ./mvnw clean package -Dquarkus.native.additional-build-args=--trace-object-instantiation=com.sun.jmx.mbeanserver.JmxMBeanServer ``` -- 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-unsubscr...@camel.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org