Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-9810

Using Java23+ results in UnsupportedOperationException calling Subject.getSubject

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • AMQ 7.14.0.GA
    • AMQ 7.13.0.GA
    • None
    • None

      Using 7.13 with Java23 results in the following error:

      java.lang.UnsupportedOperationException: getSubject is supported only if a security manager is allowed at java.base/javax.security.auth.Subject.getSubject(Subject.java:347) at org.apache.activemq.artemis.logs.AuditLogger.getCaller(AuditLogger.java:68) at org.apache.activemq.artemis.logs.AuditLogger.getNotificationInfo(AuditLogger.java:1114) at org.apache.activemq.artemis.core.management.impl.ActiveMQServerControlImpl.getNotificationInfo(ActiveMQServerControlImpl.java:4277) at java.management/com.sun.jmx.mbeanserver.MBeanIntrospector.findNotifications(MBeanIntrospector.java:446) at java.management/com.sun.jmx.mbeanserver.MBeanIntrospector.getMBeanInfo(MBeanIntrospector.java:392) at java.management/com.sun.jmx.mbeanserver.MBeanSupport.<init>(MBeanSupport.java:139) at java.management/com.sun.jmx.mbeanserver.StandardMBeanSupport.<init>(StandardMBeanSupport.java:60) at java.management/javax.management.StandardMBean.construct(StandardMBean.java:181) at java.management/javax.management.StandardMBean.<init>(StandardMBean.java:232) at org.apache.activemq.artemis.core.management.impl.AbstractControl.<init>(AbstractControl.java:49) at org.apache.activemq.artemis.core.management.impl.ActiveMQServerControlImpl.<init>(ActiveMQServerControlImpl.java:189) at org.apache.activemq.artemis.core.server.management.impl.ManagementServiceImpl.registerServer(ManagementServiceImpl.java:217) at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart1(ActiveMQServerImpl.java:3302) at org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:70) at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:720) at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:610) at org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ.start(EmbeddedActiveMQ.java:134) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580)
      
      

      This can be worked around on Java 23 only, by adding the following Java property to etc/artemis.profile:

      -Djava.security.manager=allow
      

       

      This is related to the JDK change tracked by https://bugs.openjdk.org/browse/JDK-8327134

       

      On Java 24+ further JDK change for https://bugs.openjdk.org/browse/JDK-8338625 in order to permanently disable the SecurityManager mean that this method always throws UnsupportedOperationException if called, with no workaround possible.

        1. image-2025-05-15-16-54-39-760.png
          87 kB
          John Clifford
        2. image-2025-05-15-16-56-08-952.png
          59 kB
          John Clifford

              gemmellr Robbie Gemmell
              rhn-support-jsherman Jason Sherman
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: