Does anyone have information about Authorize.net support GraalVm or not? We are moving our project to Native Image and getting following exception in creating native image:
Error: Unsupported features in 2 methods
Detailed message:
Error: 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 To see how this object got instantiated use --trace-ob
ject-instantiation=com.sun.jmx.mbeanserver.JmxMBeanServer. The object was probably created by a class initializer and is reachable from a static field. You can request class initializa
tion 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.
Trace: Object was reached by
indexing into array
constant java.lang.Object[]@7504af74 reached by
reading field java.util.ArrayList.elementData of
constant java.util.ArrayList@24b75efc reached by
scanning method javax.management.MBeanServerFactory.addMBeanServer(MBeanServerFactory.java:418)
Call path from entry point to javax.management.MBeanServerFactory.addMBeanServer(MBeanServer):
at javax.management.MBeanServerFactory.addMBeanServer(MBeanServerFactory.java:418)
at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:232)
at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:192)
at com.oracle.svm.core.jdk.management.ManagementSupport.getPlatformMBeanServer(ManagementSupport.java:257)
at com.oracle.svm.core.jdk.management.Target_java_lang_management_ManagementFactory.getPlatformMBeanServer(Target_java_lang_management_ManagementFactory.java:45)
at org.apache.logging.log4j.core.jmx.Server.unregisterLoggerContext(Server.java:248)
at org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:379)
at org.apache.logging.log4j.core.LoggerContext$1.run(LoggerContext.java:320)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:600)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
at com.oracle.svm.core.code.IsolateEnterStub.PosixJavaThreads_pthreadStartRoutine_e1f4a8c0039f8337338252cd8734f63a79b5e3df(generated:0)
Error: type is not available in this platform: org.graalvm.compiler.hotspot.management.AggregatedMemoryPoolBean
Trace: Object was reached by
reading field java.lang.ref.Reference.referent of
constant java.util.WeakHashMap$Entry@5e4acddb reached by
indexing into array
constant java.util.WeakHashMap$Entry[]@5eed71e9 reached by
reading field java.util.WeakHashMap.table of
constant com.sun.jmx.mbeanserver.MBeanIntrospector$MBeanInfoMap@33ac075d reached by
scanning method com.sun.jmx.mbeanserver.MXBeanIntrospector.getMBeanInfoMap(MXBeanIntrospector.java:68)
Call path from entry point to com.sun.jmx.mbeanserver.MXBeanIntrospector.getMBeanInfoMap():
at com.sun.jmx.mbeanserver.MXBeanIntrospector.getMBeanInfoMap(MXBeanIntrospector.java:68)
at com.sun.jmx.mbeanserver.MBeanIntrospector.getClassMBeanInfo(MBeanIntrospector.java:416)
at com.sun.jmx.mbeanserver.MBeanIntrospector.getMBeanInfo(MBeanIntrospector.java:392)
at com.sun.jmx.mbeanserver.MBeanSupport.<init>(MBeanSupport.java:139)
at com.sun.jmx.mbeanserver.MXBeanSupport.<init>(MXBeanSupport.java:66)
at com.sun.jmx.mbeanserver.Introspector.makeDynamicMBean(Introspector.java:203)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:888)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:320)
at com.sun.jmx.mbeanserver.JmxMBeanServer$2.run(JmxMBeanServer.java:1225)
at com.oracle.svm.core.jdk.Target_java_security_AccessController.doPrivileged(SecuritySubstitutions.java:123)
at java.util.ServiceLoader.loadProvider(ServiceLoader.java:859)
at java.util.ServiceLoader$LayerLookupIterator.hasNext(ServiceLoader.java:952)
at sun.java2d.SunGraphics2D.setRenderingHints(SunGraphics2D.java:1370)
at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS_SunGraphics2D_setRenderingHints_8d5833c6be813de16ff61d40a14ac79dc4dda89c(generated:0)
The issue does not explicitly points to Authorize.net SDK, but it resolved when the following dependency is removed:
<dependency>
<groupId>net.authorize</groupId>
<artifactId>anet-java-sdk</artifactId>
<version>LATEST</version>
</dependency>
I have also tried adding --initialize-at-run-time=com.sun.jmx.mbeanserver.JmxMBeanServer
, but the issue still persists
- Java version "11.0.10" 2021-01-19 LTS
- Quarkus version : 2.5.0.Final
- GraalVM: 21.3
- Maven version: Apache Maven 3.8.1