Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Java 2.0.0
-
None
Description
In OSGi, the context classloader that is used for the JAXBContext.newInstance can be a bit unpredictable. It would be better to create the JAXB context from the ObjectFactories directly:
--- src/main/java/org/apache/xml/security/stax/ext/XMLSecurityConstants.java (revision 1513267) +++ src/main/java/org/apache/xml/security/stax/ext/XMLSecurityConstants.java (working copy) @@ -76,11 +76,11 @@ try { setJaxbContext( JAXBContext.newInstance( - "org.apache.xml.security.binding.xmlenc:" + - "org.apache.xml.security.binding.xmlenc11:" + - "org.apache.xml.security.binding.xmldsig:" + - "org.apache.xml.security.binding.xmldsig11:" + - "org.apache.xml.security.binding.excc14n" + org.apache.xml.security.binding.xmlenc.ObjectFactory.class, + org.apache.xml.security.binding.xmlenc11.ObjectFactory.class, + org.apache.xml.security.binding.xmldsig.ObjectFactory.class, + org.apache.xml.security.binding.xmldsig11.ObjectFactory.class, + org.apache.xml.security.binding.excc14n.ObjectFactory.class ) ); SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);