views:

325

answers:

2

Hi, I am using an application where I have placed xerces144.jar file within WEB-INF/lib folder of war file inside an EAR file. When I deploy this EAR file to WebLogic Server and start the application, I am getting the following exception. We are using Spring MVC. However, if I deploy the same application using just the WAR file every thing works fine. I also noticed that if I removed xerces144.jar files from EAR file and deploy EAR, it is deployed without any issues. What is the difference with this xerces144.jar file when it is inlcuded in a WAR vs same WAR included in a EAR and deployed.

2009-10-27 21:05:50,468 ERROR - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Parser configuration exception parsing XML from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [org.apache.xerces.jaxp.Document BuilderFactoryImpl@19b5ed8] 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.
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
A: 

What is the difference with this xerces144.jar file when it is included in a WAR vs same WAR included in a EAR and deployed.

I think that this has something to do with classloading. When deploying a WAR or deploying the same WAR inside an EAR, Weblogic doesn't create the same hierarchy of classloaders.

The strangest part is that Weblogic 9.x ships with Xerces 1.4.4 in 3rdparty.jar (at least, this is true for 9.1, it would be interesting to check the version for 9.2). This can be easily verified by running the following command on the command line:

$ java -cp 3rdparty.jar org.apache.xerces.framework.Version

To be honest, I don't know what happens exactly and what the problem actually is when you deploy the WAR inside the EAR with Xerces packaged in the WAR. In all the scenarios you described, my understanding is that there is a Xerces jar somewhere on the classpath.

If you really want to deploy Xerces-144.jar in the WAR, could you try to set prefer-web-inf-classes in the weblogic.xml and test this configuration?

Pascal Thivent
A: 

Since weblogic does have the same version of xerces, i believe theres no need to package it within your App

Shreeni