[ 
https://issues.apache.org/jira/browse/ARTEMIS-5790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Bertram updated ARTEMIS-5790:
------------------------------------
    Description: 
We are currently migrating from Spring Boot 3 to 4 on Java 25. Spring Boot 4 
uses Artemis 2.43.0 and Netty 4.2.7.

Our server runs with an embedded Artemis broker which now fails at startup with 
the following exception: 
{noformat}
04.12.2025 14:12:52.576  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221013: 
Using NIO Journal
04.12.2025 14:12:52.609  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221057: 
Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being 
defined as 12868124672
04.12.2025 14:12:52.627  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221043: 
Protocol module found: [artemis-server]. Adding protocol support for: CORE
04.12.2025 14:12:52.628  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221043: 
Protocol module found: [artemis-openwire-protocol]. Adding protocol support 
for: OPENWIRE
04.12.2025 14:12:52.628  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221043: 
Protocol module found: [artemis-openwire-protocol]. Adding protocol support 
for: OPENWIRE
04.12.2025 14:12:52.684  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221034: 
Waiting indefinitely to obtain primary lock04.12.2025 14:12:52.684  INFO 34508 
--- [server] [           main] [                                
]o.apache.activemq.artemis.core.server    : AMQ221035: Primary Server Obtained 
primary lock
04.12.2025 14:12:52.730 ERROR 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ224000: 
Failure in initialisation
java.lang.UnsupportedOperationException: Cannot clean arbitrary ByteBuffer 
instances
 at 
io.netty.util.internal.CleanerJava25.freeDirectBuffer(CleanerJava25.java:177)
 at 
io.netty.util.internal.PlatformDependent.freeDirectBuffer(PlatformDependent.java:613)
 at 
org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory.releaseDirectBuffer(NIOSequentialFileFactory.java:138)
 at 
org.apache.activemq.artemis.core.journal.impl.JournalImpl.load(JournalImpl.java:2317)
 at 
org.apache.activemq.artemis.core.journal.impl.JournalImpl.load(JournalImpl.java:1649)
 at org.apache.activemq.artemis.core.journal.Journal.load(Journal.java:276)
 at 
org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.loadBindingJournal(AbstractJournalStorageManager.java:1659)
 at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.loadJournals(ActiveMQServerImpl.java:3837)
 at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart2(ActiveMQServerImpl.java:3469)
 at 
org.apache.activemq.artemis.core.server.impl.PrimaryOnlyActivation.run(PrimaryOnlyActivation.java:78)
 at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:754)
 at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:644)
 at 
org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ.start(EmbeddedActiveMQ.java:124)
 at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
 at java.base/java.lang.reflect.Method.invoke(Method.java:565){noformat}
The problem seems to be that {{NIOSequentialFileFactory}} calls the deprecated 
{{PlatformDependent.freeDirectBuffer}} Netty method which now delegates to the 
{{CleanerJava25}} method which throws an {{{}UnsupportedOperationException{}}}.

The issue currently blocks our Spring Boot upgrade. Would be great if it could 
be fixed or if someone would have at least an idea how to workaround it.

  was:
Hi,

we are currently migrating from Spring Boot 3 to 4 on Java 25. Spring Boot 4 
uses Artemis 2.43.0 and Netty 4.2.7.

Our server runs with an embedded Artemis broker which now fails at startup with 
the following exception: 
{noformat}
04.12.2025 14:12:52.576  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221013: 
Using NIO Journal
04.12.2025 14:12:52.609  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221057: 
Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being 
defined as 12868124672
04.12.2025 14:12:52.627  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221043: 
Protocol module found: [artemis-server]. Adding protocol support for: CORE
04.12.2025 14:12:52.628  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221043: 
Protocol module found: [artemis-openwire-protocol]. Adding protocol support 
for: OPENWIRE
04.12.2025 14:12:52.628  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221043: 
Protocol module found: [artemis-openwire-protocol]. Adding protocol support 
for: OPENWIRE
04.12.2025 14:12:52.684  INFO 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ221034: 
Waiting indefinitely to obtain primary lock04.12.2025 14:12:52.684  INFO 34508 
--- [server] [           main] [                                
]o.apache.activemq.artemis.core.server    : AMQ221035: Primary Server Obtained 
primary lock
04.12.2025 14:12:52.730 ERROR 34508 --- [server] [           main] [            
                    ]o.apache.activemq.artemis.core.server    : AMQ224000: 
Failure in initialisation
java.lang.UnsupportedOperationException: Cannot clean arbitrary ByteBuffer 
instances
 at 
io.netty.util.internal.CleanerJava25.freeDirectBuffer(CleanerJava25.java:177)
 at 
io.netty.util.internal.PlatformDependent.freeDirectBuffer(PlatformDependent.java:613)
 at 
org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory.releaseDirectBuffer(NIOSequentialFileFactory.java:138)
 at 
org.apache.activemq.artemis.core.journal.impl.JournalImpl.load(JournalImpl.java:2317)
 at 
org.apache.activemq.artemis.core.journal.impl.JournalImpl.load(JournalImpl.java:1649)
 at org.apache.activemq.artemis.core.journal.Journal.load(Journal.java:276)
 at 
org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.loadBindingJournal(AbstractJournalStorageManager.java:1659)
 at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.loadJournals(ActiveMQServerImpl.java:3837)
 at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart2(ActiveMQServerImpl.java:3469)
 at 
org.apache.activemq.artemis.core.server.impl.PrimaryOnlyActivation.run(PrimaryOnlyActivation.java:78)
 at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:754)
 at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:644)
 at 
org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ.start(EmbeddedActiveMQ.java:124)
 at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
 at java.base/java.lang.reflect.Method.invoke(Method.java:565){noformat}
The problem seems to be that NIOSequentialFileFactory calls the deprecated 
PlatformDependent.freeDirectBuffer Netty method which now delegates to the 
CleanerJava25 method which throws an UnsupportedOperationException.

The issue currently blocks our Spring Boot upgrade. Would be great if it could 
be fixed or if someone would have at least an idea how to workaround it.

Best regards, Andreas

 


> Artemis broker calls deprecated netty method on initialization which fails 
> with exception on Java 25
> ----------------------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-5790
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5790
>             Project: Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.43.0
>            Reporter: Andreas Baumgart
>            Priority: Major
>
> We are currently migrating from Spring Boot 3 to 4 on Java 25. Spring Boot 4 
> uses Artemis 2.43.0 and Netty 4.2.7.
> Our server runs with an embedded Artemis broker which now fails at startup 
> with the following exception: 
> {noformat}
> 04.12.2025 14:12:52.576  INFO 34508 --- [server] [           main] [          
>                       ]o.apache.activemq.artemis.core.server    : AMQ221013: 
> Using NIO Journal
> 04.12.2025 14:12:52.609  INFO 34508 --- [server] [           main] [          
>                       ]o.apache.activemq.artemis.core.server    : AMQ221057: 
> Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being 
> defined as 12868124672
> 04.12.2025 14:12:52.627  INFO 34508 --- [server] [           main] [          
>                       ]o.apache.activemq.artemis.core.server    : AMQ221043: 
> Protocol module found: [artemis-server]. Adding protocol support for: CORE
> 04.12.2025 14:12:52.628  INFO 34508 --- [server] [           main] [          
>                       ]o.apache.activemq.artemis.core.server    : AMQ221043: 
> Protocol module found: [artemis-openwire-protocol]. Adding protocol support 
> for: OPENWIRE
> 04.12.2025 14:12:52.628  INFO 34508 --- [server] [           main] [          
>                       ]o.apache.activemq.artemis.core.server    : AMQ221043: 
> Protocol module found: [artemis-openwire-protocol]. Adding protocol support 
> for: OPENWIRE
> 04.12.2025 14:12:52.684  INFO 34508 --- [server] [           main] [          
>                       ]o.apache.activemq.artemis.core.server    : AMQ221034: 
> Waiting indefinitely to obtain primary lock04.12.2025 14:12:52.684  INFO 
> 34508 --- [server] [           main] [                                
> ]o.apache.activemq.artemis.core.server    : AMQ221035: Primary Server 
> Obtained primary lock
> 04.12.2025 14:12:52.730 ERROR 34508 --- [server] [           main] [          
>                       ]o.apache.activemq.artemis.core.server    : AMQ224000: 
> Failure in initialisation
> java.lang.UnsupportedOperationException: Cannot clean arbitrary ByteBuffer 
> instances
>  at 
> io.netty.util.internal.CleanerJava25.freeDirectBuffer(CleanerJava25.java:177)
>  at 
> io.netty.util.internal.PlatformDependent.freeDirectBuffer(PlatformDependent.java:613)
>  at 
> org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory.releaseDirectBuffer(NIOSequentialFileFactory.java:138)
>  at 
> org.apache.activemq.artemis.core.journal.impl.JournalImpl.load(JournalImpl.java:2317)
>  at 
> org.apache.activemq.artemis.core.journal.impl.JournalImpl.load(JournalImpl.java:1649)
>  at org.apache.activemq.artemis.core.journal.Journal.load(Journal.java:276)
>  at 
> org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.loadBindingJournal(AbstractJournalStorageManager.java:1659)
>  at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.loadJournals(ActiveMQServerImpl.java:3837)
>  at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart2(ActiveMQServerImpl.java:3469)
>  at 
> org.apache.activemq.artemis.core.server.impl.PrimaryOnlyActivation.run(PrimaryOnlyActivation.java:78)
>  at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:754)
>  at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:644)
>  at 
> org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ.start(EmbeddedActiveMQ.java:124)
>  at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
>  at java.base/java.lang.reflect.Method.invoke(Method.java:565){noformat}
> The problem seems to be that {{NIOSequentialFileFactory}} calls the 
> deprecated {{PlatformDependent.freeDirectBuffer}} Netty method which now 
> delegates to the {{CleanerJava25}} method which throws an 
> {{{}UnsupportedOperationException{}}}.
> The issue currently blocks our Spring Boot upgrade. Would be great if it 
> could be fixed or if someone would have at least an idea how to workaround it.



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