[wildfly-dev] Fwd: Camel 2.14-SNAPSHOT / JMX / JAXB / Classloading

Markus Eisele myfear at web.de
Fri Sep 12 11:31:29 EDT 2014


Hi all,

I've been playing around with latest Camel 2.14 which introduces a new
metrics-component. The information get exposed via JMX/XML.
They use JAXB and bootstrapping Camel in a war on latest WildFly 8.1
(I used this a base: https://github.com/myfear/CamelEE7).
If you use JConsole or hawtio+jolokia to access the relevant mbeans
you get the following exception:

NoClassDefFoundError: Could not initialize class
com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl

Root cause is this:

public static JAXBContext createJaxbContext() throws JAXBException {
        // must use classloader from CamelContext to have JAXB working
        return JAXBContext.newInstance(Constants.JAXB_CONTEXT_PACKAGES,
CamelContext.class.getClassLoader());
    }

(https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/model/ModelHelper.java#L95)

Full stack: https://gist.github.com/myfear/7d95388bb22e313e5f4b

Google lead me to some results about AS7 .. nothing worked so far. I tried:
1) MANIFEST.MF (expot services com.sun.xml.bind)
2) jboss-deployment-structure.xml <module name="com.sun.xml.bind"
services="export" />
3) packaging JAXB 2.2.6 in the war

WildFly is the only server with those issues. It works on plain
servlet containers like Tomcat and jetty.

Any hints highly appreciated

Thanks,
Markus


More information about the wildfly-dev mailing list