Mika Räty created AMQ-9430:
------------------------------

             Summary: ActiveMQ 5.18.3 (Classic) and Java 17: 
runtimeConfigurationPlugin causes ClassNotFoundException
                 Key: AMQ-9430
                 URL: https://issues.apache.org/jira/browse/AMQ-9430
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker, JMX, Plugin
    Affects Versions: 5.18.3
         Environment: Linux myhost 6.5.0-14-generic #14~22.04.1-Ubuntu SMP 
PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux   

 

java -version                                                                   
                                                                                
        
openjdk version "17.0.9" 2023-10-17                                 
OpenJDK Runtime Environment (build 17.0.9+9-Ubuntu-122.04)
OpenJDK 64-Bit Server VM (build 17.0.9+9-Ubuntu-122.04, mixed mode, sharing)
            Reporter: Mika Räty


We are upgrading from java 8 to java 17 in a project that uses ActiveMQ 5.18.3 
and we noticed that when we try to use the JMX operation updateNow that is 
available from Bean

 

org.apache.activemq:type=Broker,brokerName=localhost,service=RuntimeConfiguration,name=Plugin

 

using java 17 based deployment we get the following error on jconsole screen

 

Failed to parse: class path resource [activemq.xml], 
javax.xml.bind.JAXBException

- with linked exception:

[java.lang.ClassNotFoundException: 
com.sun.xml.internal.bind.v2.ContextFactory];No material change to 
configuration in class path resource [activemq.xml] at: Tue Jan 30 13:09:40 EET 
2024;

 

On the activemq output we see the following stack trace

 

INFO | Manual configuration update triggered

INFO | Failed to parse: class path resource [activemq.xml]

javax.xml.bind.JAXBException: null

        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:241) 
~[jaxb-api-2.2.11.jar:?]

        at javax.xml.bind.ContextFinder.find(ContextFinder.java:477) 
~[jaxb-api-2.2.11.jar:?]

        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:656) 
~[jaxb-api-2.2.11.jar:?]

        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:599) 
~[jaxb-api-2.2.11.jar:?]

        at 
org.apache.activemq.plugin.RuntimeConfigurationBroker.loadConfiguration(RuntimeConfigurationBroker.java:176)
 ~[activemq-runtime-config-5.18.3.jar:5.18.3]

        at 
org.apache.activemq.plugin.RuntimeConfigurationBroker.applyModifications(RuntimeConfigurationBroker.java:141)
 ~[activemq-runtime-config-5.18.3.jar:5.18.3]

        at 
org.apache.activemq.plugin.RuntimeConfigurationBroker.updateNow(RuntimeConfigurationBroker.java:113)
 ~[activemq-runtime-config-5.18.3.jar:5.18.3]

        at 
org.apache.activemq.plugin.jmx.RuntimeConfigurationView.updateNow(RuntimeConfigurationView.java:53)
 ~[activemq-runtime-config-5.18.3.jar:5.18.3]

        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[?:?]

        at 
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
 ~[?:?]

        ... [ some frames omitted for brevity ]

 

Caused by: java.lang.ClassNotFoundException: 
com.sun.xml.internal.bind.v2.ContextFactory

        at 
jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) 
~[?:?]

        at 
jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
 ~[?:?]

        at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]

        at javax.xml.bind.ContextFinder.safeLoadClass(ContextFinder.java:594) 
~[jaxb-api-2.2.11.jar:?]

        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:239) 
~[jaxb-api-2.2.11.jar:?]

        ... 43 more

INFO | No material change to configuration in class path resource 
[activemq.xml] at: Tue Jan 30 12:59:42 EET 2024

 

Java version info

java -version

openjdk version "17.0.9" 2023-10-17

OpenJDK Runtime Environment (build 17.0.9+9-Ubuntu-122.04)

OpenJDK 64-Bit Server VM (build 17.0.9+9-Ubuntu-122.04, mixed mode, sharing)

 

 

Reproducing the above error:

 
 # extract amq package to linux host

tar xvf apache-activemq-5.18.3-bin.tar
 # Add plugin to activemq.xml

<plugins>

  <runtimeConfigurationPlugin checkPeriod="0"/>

</plugins>
 # Add start="false" to broker tag

according to instructions from here 
[https://activemq.apache.org/runtime-configuration]
 # Starting activemq with

activemq start
 # Connect to the started amq instance with jconsole and call the updateNow 
operation

 

 

Observations

 

If we don't add the start attribute with value false the class not found error 
is not shown but the configuration reload operation doesn't happen at all and 
this is the output 
No material change to configuration in null at: Thu Jan 01 01:59:59 EET 1970;

 



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

Reply via email to