0

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 
4

2 回答 2

1

当这个 xerces144.jar 文件包含在 WAR 中与包含在 EAR 中并部署的相同 WAR 时,它有什么区别。

我认为这与类加载有关。在 EAR 中部署 WAR 或部署相同的 WAR 时,Weblogic 不会创建相同的类加载器层次结构。

最奇怪的部分是 Weblogic 9.x 在 3rdparty.jar 中附带了 Xerces 1.4.4(至少 9.1 是这样,检查 9.2 的版本会很有趣)。这可以通过在命令行上运行以下命令轻松验证:

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

老实说,当您在 EAR 中部署 WAR 并在 WAR 中打包 Xerces 时,我不知道究竟发生了什么以及实际问题是什么。在您描述的所有场景中,我的理解是在类路径的某处有一个 Xerces jar。

如果你真的想在 WAR 中部署 Xerces-144.jar,你可以尝试在 WAR 中设置prefer-web-inf-classesweblogic.xml测试这个配置吗?

于 2009-10-28T23:20:52.570 回答
0

由于 weblogic 确实具有相同版本的 xerces,我相信无需将其打包到您的应用程序中

于 2009-11-10T11:21:07.097 回答