Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » XML parser implementation
XML parser implementation [message #648757] Fri, 14 January 2011 07:45 Go to next message
Eva Troels is currently offline Eva Troels
Messages: 17
Registered: December 2010
Junior Member
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?

/Eva
Re: XML parser implementation [message #648786 is a reply to message #648757] Fri, 14 January 2011 09:08 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1186
Registered: July 2009
Senior Member
Does the parser dependent web bundle accidentally export any XML parser packages?
Re: XML parser implementation [message #648792 is a reply to message #648786] Fri, 14 January 2011 09:21 Go to previous messageGo to next message
Eva Troels is currently offline Eva Troels
Messages: 17
Registered: December 2010
Junior Member
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??

/Eva
Re: XML parser implementation [message #648798 is a reply to message #648792] Fri, 14 January 2011 09:30 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1186
Registered: July 2009
Senior Member
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?
Re: XML parser implementation [message #648805 is a reply to message #648798] Fri, 14 January 2011 10:19 Go to previous messageGo to next message
Eva Troels is currently offline Eva Troels
Messages: 17
Registered: December 2010
Junior Member
Haven't tried that.
Setting the parameters

-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apach e.xerces.internal.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.transform.TransformerFactory=com.sun.org.apache. xalan.internal.xsltc.trax.TransformerFactoryImpl -Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerc es.internal.jaxp.SAXParserFactoryImpl

in the virgo servers launch configuration got me past the error, though.

/Eva
Re: XML parser implementation [message #648809 is a reply to message #648805] Fri, 14 January 2011 10:35 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1186
Registered: July 2009
Senior Member
I suppose desperate times call for desperate measures.

Glad you are making progress now. Smile
Re: XML parser implementation [message #648965 is a reply to message #648809] Sun, 16 January 2011 15:11 Go to previous message
Eva Troels is currently offline Eva Troels
Messages: 17
Registered: December 2010
Junior Member
Right you are!

You are probably right that the Oracle code is osgi-hostile - using System.setProperty or something like that.

Oh well Smile

/Eva
Previous Topic:Virgo over-constraing version numbers?
Next Topic:Building Virgo Kernel on Windows (7)
Goto Forum:
  


Current Time: Tue May 21 20:30:01 EDT 2013

Powered by FUDForum. Page generated in 0.03470 seconds