I have some legacy code with dependencies to Oracles Xml parser v. 2.
I would like to deploy this as web bundle.
In order to make the code work - i need to add the jar xmlparserv2-1.0.0.jar to my bundles classpath. I have just added the jar to the lib folder in the META-INF of my bundle and added the jar to my bundles Bundle-Classpath in the MANIFEST.
This seems to work -- but now one of my other (Spring) bundles complains with
Caused by: javax.xml.parsers.FactoryConfigurationError: Provider oracle.xml.jaxp.JXDocumentBuilderFactory not found
at javax.xml.parsers.DocumentBuilderFactory.newInstance(Documen tBuilderFactory.java:129)
at org.springframework.beans.factory.xml.DefaultDocumentLoader. createDocumentBuilderFactory(DefaultDocumentLoader.java:89)
at org.springframework.beans.factory.xml.DefaultDocumentLoader. loadDocument(DefaultDocumentLoader.java:70)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReade r.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
when parsing the bean definition.
The Oracle parser dependent web bundle is deployed in a PAR containing other bundles as well.
Why does adding the oracle xml parser jar to a bundles (private??) classpath affect the other bundles in my PAR?
Shouldn't they still use the standard XML parser in Java 6?
No, the only Export-Packages are internal business logic classes.
The oracle parser jar contains classes in the packages javax.xml.parsers, javax.xml.transform, javax.xml.transform.dom, javax.transform.sax, javax.transform.stream.
But why do the classes in these packages show up on the other bundles classpath??
I guess it's due to the peculiar way in which document builder factories are located, which is presumably not OSGi friendly. I'd be very surprised if the Oracle classes are actually loadable from the other bundles.
Not sure how to proceed on this one. Have you tried deploying the bundles outside a PAR for comparison?
Sorry to brings to this old thread alive again, but I've got this problem here to.
I have a bundle that embeds Eclipse Birt Runtime using Bundle ClassPath, and after do that, some other bundles have throw this error by simple loading their spring contexts.
Can a bundle classpath inner dependency, afect how another bundles context is loaded? This can be some bug? I can post a test case to replicate this problem if needed.
It would be great if you can provide a "small" test case to reproduce this problem. Then it will be much easier for interested people digging into this problem if they can spare some time.
I've tried to create a test case, but I can't replicate the problem only configuring the Bundle-Classpath with the xml parser..
I guess that Birt Report Engine sets a new parser when it is configured. Post a test project case, with all the Birt runtime will be a bad idea (about 50MB). I will post more details!