0

I have two applications that I must deploy on the same tomcat (version 7.0.56).

Application A uses xerces (have a dependency to xercesimpl.jar). The second application (B) does not have that dependency, but is doing some xml work.

When deploying application B alone on the server, all works fine. When deploying application B along with application A on the same server, I got an exception when application B tries to do its xml work :

org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

This mean in application B, the server still sees xercesimpl.jar/META-INF/services/javax.xml.parsers.SAXParserFactory

I'm using tomcat with eclipse (mars) via wtp. Anyone have the same problème or any information on that kind of situation ?

For me, that means that if an application in tomcat is using xerces, then all applications on the same server must use xerces.

baraber
  • 3,296
  • 27
  • 46
  • I've tried to reproduce your experiment with two webapps, but mine works well. Have you found out where is this META-INF/services/etc is actually being read from? Call `getClass().getClassLoader().getResources("META-INF/services/javax.xml.parsers.SAXParserFactory")` in each webapp and print out the results. – Little Santi Oct 31 '15 at 09:14
  • What version of xercesImpl are you using? What version of Java? – Little Santi Oct 31 '15 at 09:18
  • Another suggestion: Run your server with `-Djaxp.debug=1` and read the traces displayed in the output. – Little Santi Oct 31 '15 at 09:22

0 Answers0