tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean Pierre Urkens" <jean-pierre.urk...@devoteam.com>
Subject RE: Tomcat Xml parser issue
Date Fri, 17 Nov 2017 06:54:46 GMT
Vicky,

I am using both SPRING and Oracle XML features in a project and indeed the oracle xmlparser
installs itself as default parser.

To prevent this I start the VM with following settings (JDK8):
	-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl

	-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl

	-Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl


This will force the use of default parsers that come with the JDK/JRE. And when I need the
Oracle XMLParser (e.g. when handling XMLTYPE records/columns from the database) I use (within
the code) the Oracle parser.


-----Original Message-----
From: Vicky B [mailto:vickyb2084@gmail.com] 
Sent: donderdag 16 november 2017 19:30
To: Tomcat Users List <users@tomcat.apache.org>
Subject: Re: Tomcat Xml parser issue

Thanks but the same war works fine is WebSphere and tomcat on Windows it is just tomcat provided
by  Redhat which work different i.e it throws the exception

On Nov 16, 2017 11:39 PM, "Christopher Schultz" < chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Vicky,
>
> On 11/16/17 12:24 PM, Vicky B wrote:
> > It is XML parser (DOM and SAX ) from oracle (doc 
> > <https://docs.oracle.com/cd/B10501_01/appdev.920/a96609/arj_xmlparse
> > rv
> 2.htm>)
> >
> >
> .
>
> Why do you need a custom XML parser? Why not simply use the one 
> bundled with the JRE?
>
> > Why is tomcat using XMLparserv2
>
> Where is the xmlparserv2.jar file? Some badly-behaved libraries 
> install themselves as the "system" parser when they are used even if 
> they aren't being loaded by the system or application (which doesn't 
> mean YOUR application) ClassLoader. If that happens, you can get weird 
> problems like this.
>
> > tomcat we have in linux machine is from redhat . Why does tomcat 
> > downloaded from apache tomcat site work different form the one 
> > provided by REDHat.
>
> Package managers often make adjustments that make sense for their 
> environments. I suspect that this problem has less to do with RedHat's 
> Tomcat package and more to do with how you deploy your application, 
> its libraries, etc.
>
> > how does class loading work in tomcat.
>
> Tomcat sets up a ClassLoader for itself to work in. For each webapp, a 
> separate ClassLoader is created for them to work in with the Tomcat 
> server ClassLoader as the parent. But the webapp's ClassLoader is a 
> "child-first" ClassLoader meaning that classes and libraries bundled 
> with the application are preferred when code is executing in the 
> application's context.
>
> If you had told us your Tomcat version (or anything else about your 
> environment), we might have been able to help more, but you aren't 
> providing much in the way of information.
>
> Assuming Tomcat 8.0 (because why not?), here is the explanation for 
> how class loading works in Tomcat. Almost as if someone was /trying/ 
> to make that information available for people looking for it.
>
> https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html
>
> - -chris
>
> > On Thu, Nov 16, 2017 at 8:15 PM, Christopher Schultz < 
> > chris@christopherschultz.net> wrote:
> >
> > Vicky,
> >
> > On 11/16/17 6:53 AM, Vicky B wrote:
> >>>> Hi All,
> >>>>
> >>>> I have application which is using spring , ESAPI and oracle 
> >>>> xmlparserv2.jar , this application works fine in my local tomcat 
> >>>> on windows  but when i deployed in linux server with linux based 
> >>>> apache tomcat i got below error when spring container  was trying 
> >>>> to parse  application specific xmls
> >>>>
> >>>> org.apache.catalina.core.StandardContext.listenerStart
> >>>> Exception sending context initialized event to listener instance 
> >>>> of class org.springframework.web.context.ContextLoaderListener
> >>>>
> >>>> org.springframework.beans.factory.BeanDefinitionStoreException:
> >>>>
> >>>>
> Parser configuration exception parsing XML from class path
> >>>> resource [spring/spring-context.xml]; nested exception is
> >>>> javax.xml.parsers.ParserConfigurationException: Unable to 
> >>>> validate using XSD: Your JAXP provider 
> >>>> [oracle.xml.jaxp.JXDocumentBuilderFactory@526ad194] does not 
> >>>> support XML Schema. Are you running on Java 1.4 with Apache 
> >>>> Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD 
> >>>> support.
> >>>>
> >>>>
> >>>> when i removed xmlparserv2.jar from my war file the application 
> >>>> worked fine , what is the issue is this due to class loading 
> >>>> issue or could be possible reason for this issue . Does tomcat 
> >>>> provide xml parser which spring loads.
> >
> > What is xmlparserv2.jar?
> >
> > -chris
> >>
> >> -------------------------------------------------------------------
> >> --
> >>
> >>
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >
> >
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAloN1HEdHGNocmlzQGNo
> cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFgmGw//fHmI57J/4FbsA14y
> Fdm8rVjx4i6uktp4Uue6eLYAmknGuBUuwzHjL9QGfD4exZFm1ve9AckS6H4CjrZL
> 4r9ewVc0Vqpslbztymw7eJMY2+A4Ra8nGDot6uFbjmLmmd1a/whMjBwZZVtqzJQq
> IrdqHBikZEZKHI/5l3YOx38TKGKevMveQySzge7JKcqd8DnlukxTkyBC/hgv22mh
> w0g/m5XdSilNSMd4NOI8nznaCNgrBGaiUgwApg8RWuBRh1QRGt7ETG/BOETaz2lD
> y7x0+2xqoo1aV6HspPoi6A2JQ+eNxoDcBL9Q+BsDGGBx4JwfveMFMT2hyi+Xpjax
> eQVBKNcpF2sdISX1ApNgtgLACHvSXIckSJslOYyZlAeI9G9w2wuyDn3WoOtUwQTe
> L+1RNloBZ4TX7lY7MnxQAS3XnKvL9bVXVOIOqosQ2bdbABNODl/6ghTOWC+fRPcO
> 8GdbLvt++/s8zQxzb8g9SnsqiX++hgHQHXol/4WKXMZBnJwc4em2pjuSn+HV4bwH
> kt0AF4TzKnbfQdlFZ9u6uS/lOLNbUU5fQR9x7Ssj1GnfsIgqwjVaMEipo8Ro+myx
> eFid1I33u0ikzc4cmS+78pL5YyXxFlLpz7ZQFa3VNcXe41tahk3TUhJwa8Yu7+bU
> 5CDBSfCVQT5VOm5uW7e3lPhnLLo=
> =DMVE
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message