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: 1198
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: 1198
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: 1198
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 messageGo to next 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
Re: XML parser implementation [message #1122793 is a reply to message #648757] Tue, 01 October 2013 19:36 Go to previous messageGo to next message
Eduardo Frazão is currently offline Eduardo Frazão
Messages: 108
Registered: January 2012
Senior Member
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.

Re: XML parser implementation [message #1123071 is a reply to message #1122793] Wed, 02 October 2013 02:57 Go to previous messageGo to next message
Florian Waibel is currently offline Florian Waibel
Messages: 51
Registered: June 2010
Member
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.

[Updated on: Wed, 02 October 2013 06:37]

Report message to a moderator

Re: XML parser implementation [message #1123312 is a reply to message #1123071] Wed, 02 October 2013 08:32 Go to previous messageGo to next message
Eduardo Frazão is currently offline Eduardo Frazão
Messages: 108
Registered: January 2012
Senior Member
Sure! I will do that this afternoon! Thanks!
Re: XML parser implementation [message #1123736 is a reply to message #1123071] Wed, 02 October 2013 17:49 Go to previous message
Eduardo Frazão is currently offline Eduardo Frazão
Messages: 108
Registered: January 2012
Senior Member
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!
Previous Topic:Virgo Project wil be archived?
Next Topic:Virgo project about to be deleted!
Goto Forum:
  


Current Time: Tue Oct 08 02:28:21 EDT 2013

Powered by FUDForum. Page generated in 0.01843 seconds