Hi JB, I created the following jira https://issues.apache.org/jira/browse/AMQ-9430 for this.
At the moment we are using a workaround where we modify the activemq start script, but would be nice if we didn’t have to do it this way. Regards, Mika Räty -----Original Message----- From: Jean-Baptiste Onofré <j...@nanthrax.net> Sent: Tuesday, January 30, 2024 6:24 PM To: users@activemq.apache.org Subject: Re: ActiveMQ 5.18.3 (Classic) and Java 17: runtimeConfigurationPlugin causes ClassNotFoundException [Et saa yleensä sähköpostia j...@nanthrax.net. Lisätietoja siitä, miksi tämä on tärkeää, on osoitteessa https://aka.ms/LearnAboutSenderIdentification ] CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information. Hi Mika, It's related to the RuntimeConfigurationPlugin and its JAXB usage. It needs an additional lib to work out of the box. I propose to create a Jira, providing the workaround you can use and fix in next 5.18.x release. Sorry for the inconvenience (I didn't test RuntimeConfigurationPlugin to be honest). Regards JB On Tue, Jan 30, 2024 at 1:17 PM Mika Raty (Nokia) <mika.r...@nokia.com.invalid> wrote: > > Hello everyone, > > 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=RuntimeCo > nfiguration,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: > > > 1. extract amq package to linux host tar xvf > apache-activemq-5.18.3-bin.tar > > > 1. Add plugin to activemq.xml > <plugins> > <runtimeConfigurationPlugin checkPeriod="0"/> </plugins> > > > 1. Add start="false" to broker tag > according to instructions from here > https://activemq.apache.org/runtime-configuration > > > 1. Starting activemq with > > activemq start > > > 1. 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; > > Questions > > > 1. Is the problem in our configuration? > 2. Are we missing some vital startup option? > 3. Is this not supported in 5.18.3 using java 17? > 4. Problem with activemq itself > > Any insights or suggestions would be greatly appreciated. > > Thank you, > Mika Räty