4

由于深红色罐子的存在,我面临着几个问题,大多数论坛发布此类问题的解决方案是摆脱它。

例如:

原因:java.lang.IllegalArgumentException:在 org.apache.crimson.jaxp.DocumentBuilderFactoryImpl.setAttribute(DocumentBuilderFactoryImpl.java:93) 处没有实现任何属性

发布的解决方案是:

如果您只是想开始使用 xml,我建议您使用当前的 JAXP 或包含 jaxp 1.4 的最新 jdk。从 1.3 版开始,JAXP 已经取代了 Crimson 解析器。参考 1.3 发行说明https://jaxp.java.net/1.3/ReleaseNotes.html

但是当我删除这个crimson.jar时,我开始到处面临问题,比如:

Jan 22, 2013 8:26:07 PM org.apache.tomcat.util.digester.Digester warning
WARNING: Parse Warning Error at line 1 column 0: URI was not reported to parser for entity [document]
org.xml.sax.SAXParseException: URI was not reported to parser for entity [document]
    at gnu.xml.aelfred2.SAXDriver.warn(SAXDriver.java:934)
    at gnu.xml.aelfred2.SAXDriver.startExternalEntity(SAXDriver.java:631)
    at gnu.xml.aelfred2.XmlParser.pushURL(XmlParser.java:3358)
    at gnu.xml.aelfred2.XmlParser.doParse(XmlParser.java:159)
    at gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:320)
    at gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:294)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1543)
    at org.apache.catalina.startup.TldConfig.tldScanStream(TldConfig.java:553)
    at org.apache.catalina.startup.TldConfig.tldScanWebXml(TldConfig.java:383)
    at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:299)
    at org.apache.catalina.startup.TldConfig.lifecycleEvent(TldConfig.java:585)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5061)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:525)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1360)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1406)
    at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:832)
    at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:347)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:591)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Jan 22, 2013 8:26:07 PM org.apache.tomcat.util.digester.Digester warning
WARNING: Parse Warning Error at line 3 column 138: No base URI; hope URI is absolute: http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
org.xml.sax.SAXParseException: No base URI; hope URI is absolute: http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
    at gnu.xml.aelfred2.SAXDriver.warn(SAXDriver.java:934)
    at gnu.xml.aelfred2.XmlParser.readExternalIds(XmlParser.java:2399)
    at gnu.xml.aelfred2.XmlParser.parseDoctypedecl(XmlParser.java:804)
    at gnu.xml.aelfred2.XmlParser.parseProlog(XmlParser.java:522)
    at gnu.xml.aelfred2.XmlParser.parseDocument(XmlParser.java:414)
    at gnu.xml.aelfred2.XmlParser.doParse(XmlParser.java:167)
    at gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:320)
    at gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:294)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1543)
    at org.apache.catalina.startup.TldConfig.tldScanStream(TldConfig.java:553)
    at org.apache.catalina.startup.TldConfig.tldScanWebXml(TldConfig.java:383)
    at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:299)
    at org.apache.catalina.startup.TldConfig.lifecycleEvent(TldConfig.java:585)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5061)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:525)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1360)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1406)
    at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:832)
    at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:347)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:591)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Jan 22, 2013 8:26:08 PM org.apache.tomcat.util.digester.Digester warning
WARNING: Parse Warning Error at line 3 column 140: No base URI; hope this SYSTEM id is absolute: http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
org.xml.sax.SAXParseException: No base URI; hope this SYSTEM id is absolute: http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
    at gnu.xml.aelfred2.SAXDriver.warn(SAXDriver.java:934)
    at gnu.xml.aelfred2.SAXDriver.absolutize(SAXDriver.java:606)
    at gnu.xml.aelfred2.SAXDriver.resolveEntity(SAXDriver.java:585)
    at gnu.xml.aelfred2.XmlParser.pushURL(XmlParser.java:3336)
    at gnu.xml.aelfred2.XmlParser.parseDoctypedecl(XmlParser.java:845)
    at gnu.xml.aelfred2.XmlParser.parseProlog(XmlParser.java:522)
    at gnu.xml.aelfred2.XmlParser.parseDocument(XmlParser.java:414)
    at gnu.xml.aelfred2.XmlParser.doParse(XmlParser.java:167)
    at gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:320)
    at gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:294)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1543)
    at org.apache.catalina.startup.TldConfig.tldScanStream(TldConfig.java:553)
    at org.apache.catalina.startup.TldConfig.tldScanWebXml(TldConfig.java:383)
    at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:299)
    at org.apache.catalina.startup.TldConfig.lifecycleEvent(TldConfig.java:585)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5061)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:525)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1360)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1406)
    at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:832)
    at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:347)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:591)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Jan 22, 2013 8:26:08 PM org.apache.catalina.startup.XmlErrorHandler logFindings

一些人提到使用 jaxp 1.4 jar,其他人提到 xerces 是 crimson.jar 的替代品。我都使用过,但我仍然收到那些警告异常。

所以我的问题是:从我的应用程序中删除/替换此 jar 和/或任何相关 jar 所需的步骤是什么?

4

1 回答 1

0

根据http://xml.apache.org/crimson/网页

2010/08/06 - Apache Crimson 已退役。

Crimson 代码库基于 Sun Project X 解析器。它也是目前在 Sun 产品中提供的解析器;但是,未来的计划是迁移到另一个名为 Xerces Java 2 的代码库。Xerces 2 目前正在开发中。[链接到 Xerces 2,一旦创建了项目页面。]

所以 Xerces 是所需要的,但问题是 xerces 库应该放在哪里,如果它作为你的战争的一部分,它将产生上面提出的所有问题,而不是它不应该是你的战争库的一部分,它应该是服务器共享库

对于 tomcat,您可以将其放在 lib 文件夹中,对于 Websphere,您可以将其放在任何位置并将其添加到您的应用程序共享库类路径中。

于 2013-02-05T09:41:19.457 回答