[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

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,


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


More information about the wildfly-dev mailing list