WebLogic 9.2 和 Xerces144.jar 中的 EAR 异常
我正在使用一个应用程序,其中我已将 xerces144.jar 文件放置在 EAR 文件内的 war 文件的 WEB-INF/lib 文件夹中。当我将此 EAR 文件部署到 WebLogic Server 并启动应用程序时,出现以下异常。我们正在使用 Spring MVC。但是,如果我仅使用 WAR 文件部署相同的应用程序,则一切正常。我还注意到,如果我从 EAR 文件中删除 xerces144.jar 文件并部署 EAR,则部署时不会出现任何问题。当此 xerces144.jar 文件包含在 WAR 中与包含在 EAR 中并部署的相同 WAR 中时,该文件有什么区别。
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于weblogic确实有相同版本的xerces,我相信没有必要将其打包到您的应用程序中
Since weblogic does have the same version of xerces, i believe theres no need to package it within your App
我认为这与 类加载。当部署 WAR 或在 EAR 内部署相同的 WAR 时,Weblogic 不会创建相同的类加载器层次结构。
最奇怪的部分是 Weblogic 9.x 在 3rdparty.jar 中附带了 Xerces 1.4.4(至少,对于 9.1 来说是这样,检查 9.2 的版本会很有趣)。这可以通过在命令行上运行以下命令轻松验证:
说实话,当您将 WAR 部署到 EAR 中并使用打包在 WAR 中的 Xerces 时,我不知道到底会发生什么以及实际问题是什么。在您描述的所有场景中,我的理解是类路径上的某个位置有一个 Xerces jar。
如果您确实想在 WAR 中部署 Xerces-144.jar,您可以尝试设置 prefer-web-inf-classes 在
weblogic.xml
中并测试此配置?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:
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?