Hi,


I'm trying to deploy a wrapped legacy library, which contains some JAXB code, 
into ServiceMix 5.3.0 and encountered some JAXBContext creation and 
initialization problem. Here's the details:


The legacy Java library was built with javax.xml.bin:jaxb-api-2.2 and 
com.sun.xml.bind:jaxb-impl-2.2.11 as dependencies.



The legacy Java library is wrapped with a bundle that uses the 
maven-bundle-plugin to embed the legacy library and all its dependencies in the 
bundle as individual jars (non-inline). The legacy library is specified as the 
bundle's dependency.



When trying to deploy the bundle into ServiceMix, I got the error:



>Err: Provider com.sun.xml.internal.bind.v2.ContextFactory could not be 
>instantiated: javax.xml.bind.JAXBException: 
>"mil.oasis.names.tc.SAML._1_0.protocol" doesnt contain ObjectFactory.class or 
>jaxb.index





If I exclude the jaxb-api and jaxb-impl jars from the bundle and deploy the 
bundle, I get the error:



>Err: "mil.oasis.names.tc.SAML._1_0.protocol" doesnt contain 
>ObjectFactory.class or jaxb.index





So either way, I can't get JAXBContext instantiated and initialized.



In the debugger, it looked like the classloader, which ever one that was used 
to load the JAXB provider, could not find the 
"META-INF/services/javax.xml.bind.JAXBContext" resource, which should've been 
in the jaxb-impl jar or ServiceMix's implementation jar.



Thanks in advance for any help and pointers.



Gang

Reply via email to