从应用程序中删除crimson.jar所需的步骤是什么?

时间:2013-01-22 17:06:18

标签: java xml-parsing

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

例如:

  

引起:java.lang.IllegalArgumentException:没有属性   实施       在org.apache.crimson.jaxp.DocumentBuilderFactoryImpl.setAttribute(DocumentBuilderFactoryImpl.java:93)

并且发布的解决方案是:

  

我建议使用当前的JAXP或最新的jdk   如果您只是尝试使用xml,请包含jaxp 1.4。 JAXP   从版本1.3开始,它已经取代了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的必要步骤是什么?

1 个答案:

答案 0 :(得分: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,您可以将它放在Websphere的lib文件夹中,您可以将它放在任何位置并将其添加到应用程序共享库类路径中。