Xerces 错误:org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl [英] Xerces error: org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl

查看:32
本文介绍了Xerces 错误:org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 JSF 2.0、NetBeans 6.9.1、GlassFish Server 3.1、mojarra 2.0.3 和 JasperReports 3.7.6 开发 Web 应用程序.我的项目库中包含 jar 文件xerces-2.8.0.jar".该文件是作为 JasperReports jar 文件库的一部分导入的.每当我尝试通过 NetBeans 部署、运行或调试我的项目时,我都会收到此错误:

I'm developing a web application using JSF 2.0, NetBeans 6.9.1, GlassFish Server 3.1, mojarra 2.0.3, and JasperReports 3.7.6. Included in my project library is the jar file "xerces-2.8.0.jar". This file was imported as part of the JasperReports jar file library. Whenever I try to deploy, run, or debug my project through NetBeans, I receive this error:

java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.

在我的项目中进行任何更改后,我的构建失败,并且当我尝试部署、运行或调试它时收到上述错误.我必须重新启动服务器并再次运行/调试.我已经在互联网上搜索过,但找不到解决此问题的方法.我查看了有问题的 jar 文件,并且 DTDDVFactoryImpl 确实从 DTDDVFactory 扩展 - 我不知道为什么我会收到此错误.虽然我最终可以让我的项目运行,但如果我没有收到此错误会更好.

After any change in my project my build fails, and I receive the above error, when I try to deploy, run, or debug it. I have to restart the server and run/debug a second time. I've searched the internet and cannot find a solution to this problem. I've looked at the jar file in question, and and DTDDVFactoryImpl does indeed extend from DTDDVFactory - I don't know why I'm receiving this error. While I can eventually get my project running, it would be much nicer if I wasn't receiving this error.

谁能告诉我如何解决这个问题?我需要从我的项目库中删除这个文件吗?我需要用新版本/旧版本更新这个文件吗?

Can anyone please tell me how I can fix this? Do I need to remove this file from my project library? Do I need to update this file with a newer version/older version?

推荐答案

如果您提供自己的 xerces.jar,则必须通过 Endorsed Standards Override Mechanism (java -Djava.endorsed.dirs=/path/to/xerces.jar),你不能只将它添加到类路径中(如果你这样做,迟早会遇到麻烦).让我解释一下.

If you provide your own xerces.jar, you have to do that through the Endorsed Standards Override Mechanism (java -Djava.endorsed.dirs=/path/to/xerces.jar), you are not allowed to just add it on the classpath (and will sooner or later run into trouble if you do). Let me explain.

JAXP 是用于 XML 处理的 Java API.JAXP 对象(如解析器、XSLT 转换器、DOM 文档)的创建是通过 factory/factory-method 模式完成的 这样你就可以插入一个新的 JAXP 实现(它必须比你的 JRE 中提供的更新).Xerces 提供(部分)JAXP 实现并包含认可标准(认可标准是通过标准流程而不是 Java Community Process 定义的 Java API,请参阅 认可的标准覆盖机制).如果你不使用 ESOM,你会遇到各种各样的麻烦.

JAXP is the Java API for XML Processing. The creation of JAXP objects (like parsers, XSLT transfomers, DOM Documents) is done through the factory/factory-method pattern so you can plugin a new JAXP implementation (it has to be newer than the one provided in your JRE). Xerces provides (part of) a JAXP implementation and contains endorsed standards (an endorsed standard is a Java API defined through a standards process other than the Java Community Process, see the Endorsed Standards Override Mechanism). You'll run in all kinds of troubles if you don't use the ESOM.

这篇关于Xerces 错误:org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆