[ 
https://issues.apache.org/jira/browse/ARTEMIS-4975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18031156#comment-18031156
 ] 

Aurélien Pupier edited comment on ARTEMIS-4975 at 10/20/25 1:43 PM:
--------------------------------------------------------------------

With JDK 25, it is never working. the Subject.GetSubject implementation is now 
always throwing an UnsupportedOperationException:

{noformat}
    /**
     * Throws {@code UnsupportedOperationException}. A replacement API
     * named {@link #current()} has been added which can be used to obtain
     * the current subject.
     *
     * @param  acc ignored
     *
     * @return  n/a
     *
     * @throws UnsupportedOperationException always
     *
     * @deprecated This method used to get the subject associated with the
     *       provided {@link AccessControlContext}, which was only useful in
     *       conjunction with {@linkplain SecurityManager the Security Manager},
     *       which is no longer supported. This method has been changed to
     *       always throw {@code UnsupportedOperationException}. A replacement
     *       API named {@link #current()} has been added which can be used to
     *       obtain the current subject. There is no replacement for the
     *       Security Manager.
     *
     * @see #current()
     */
    @SuppressWarnings("removal")
    @Deprecated(since="17", forRemoval=true)
    public static Subject getSubject(final AccessControlContext acc) {
        throw new UnsupportedOperationException("getSubject is not supported");
    }
{noformat}


was (Author: apupier):
With JDK 25, it is never working. the Subject.GetSubject implementation is now 
always throwing an UnsupportedOperationException:

{noformaŧ}
    /**
     * Throws {@code UnsupportedOperationException}. A replacement API
     * named {@link #current()} has been added which can be used to obtain
     * the current subject.
     *
     * @param  acc ignored
     *
     * @return  n/a
     *
     * @throws UnsupportedOperationException always
     *
     * @deprecated This method used to get the subject associated with the
     *       provided {@link AccessControlContext}, which was only useful in
     *       conjunction with {@linkplain SecurityManager the Security Manager},
     *       which is no longer supported. This method has been changed to
     *       always throw {@code UnsupportedOperationException}. A replacement
     *       API named {@link #current()} has been added which can be used to
     *       obtain the current subject. There is no replacement for the
     *       Security Manager.
     *
     * @see #current()
     */
    @SuppressWarnings("removal")
    @Deprecated(since="17", forRemoval=true)
    public static Subject getSubject(final AccessControlContext acc) {
        throw new UnsupportedOperationException("getSubject is not supported");
    }
{noformat}

> Artemis is incompatible with Java 23+
> -------------------------------------
>
>                 Key: ARTEMIS-4975
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4975
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.31.2
>            Reporter: Stephane Nicoll
>            Priority: Major
>
> Using Artemis with Java 23 leads to the following exception on startup:
> {noformat}
>     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)
> {noformat}
> With the Security Manager being disallowed by default, it looks like 
> https://bugs.openjdk.org/browse/JDK-8327134 is relevant.
> Let me know if a reproducer is necessary but I found out running Spring 
> Boot's test suite with Java 23 so it should be pretty straightforward to 
> reproduce.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to