Struts 1.3.10 Digester.getParser() UnsupportedOperationException
我正在尝试使用 OC4J 版本 10.1.3.5 启动 Struts 1.X(版本 1.3.10)应用程序。应用程序设法初始化所有Spring bean,包括action-servlet.xml 中定义的Struts Actions。然而,一旦所有的 bean 都被初始化,我就会在日志中得到一个相当丑陋的异常。
我怀疑 xalan (2.7.1)、xercesImpl (2.9.1) 或 xml-apis (1.3.04) 存在问题,但所有这些都使用最新版本。异常表明可能缺少依赖项,但我无法确定它可能是什么。
任何帮助表示赞赏。 (注意:我目前无法更新到 Struts 2.X。该应用程序是旧版应用程序,可能会被替换)。
Digester.getParser: 08:18:10,794 ERROR Digester(789)
java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
at javax.xml.parsers.SAXParserFactory.setXIncludeAware(SAXParserFactory.java:390)
at org.apache.commons.digester.Digester.getFactory(Digester.java:534)
at org.apache.commons.digester.Digester.getParser(Digester.java:786)
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1785)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2528)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:5006)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4930)
at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:5118)
at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1283)
at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:848)
at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:435)
at com.evermind.server.Application.getHttpApplication(Application.java:592)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:2280)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:2199)
at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:701)
at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:308)
at com.evermind.server.http.HttpServer.setSites(HttpServer.java:280)
at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:180)
at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2541)
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1058)
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:131)
at java.lang.Thread.run(Thread.java:595)
Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency. 08:18:10,802 ERROR ActionServlet(398)
java.lang.NullPointerException
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1785)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2528)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:5006)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4930)
at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:5118)
at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1283)
at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:848)
at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:435)
at com.evermind.server.Application.getHttpApplication(Application.java:592)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:2280)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:2199)
at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:701)
at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:308)
at com.evermind.server.http.HttpServer.setSites(HttpServer.java:280)
at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:180)
at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2541)
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1058)
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:131)
at java.lang.Thread.run(Thread.java:595)
Digester.getParser: 08:18:20,228 ERROR Digester(789)
java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
at javax.xml.parsers.SAXParserFactory.setXIncludeAware(SAXParserFactory.java:390)
at org.apache.commons.digester.Digester.getFactory(Digester.java:534)
at org.apache.commons.digester.Digester.getParser(Digester.java:786)
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1785)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2528)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:5006)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4930)
at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:3139)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:775)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:226)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:127)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:116)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency. 08:18:20,231 ERROR ActionServlet(398)
java.lang.NullPointerException
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1785)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2528)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:5006)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4930)
at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:3139)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:775)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:226)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:127)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:116)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
I am attempting to start up a Struts 1.X (version 1.3.10) application using OC4J version 10.1.3.5. The application manages to initialize all the Spring beans, including the Struts Actions defined in action-servlet.xml. However, once all the beans are initialized, I get a rather ugly exception in the log.
I suspected an issue in xalan (2.7.1), xercesImpl (2.9.1), or xml-apis (1.3.04), but all these are using the newest versions. The exception says that a dependency may be missing, but I am unable to determine what it might be.
Any help is appreciated. (Note: I can't update to Struts 2.X at this time. The application is a legacy one that will likely be replaced).
Digester.getParser: 08:18:10,794 ERROR Digester(789)
java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
at javax.xml.parsers.SAXParserFactory.setXIncludeAware(SAXParserFactory.java:390)
at org.apache.commons.digester.Digester.getFactory(Digester.java:534)
at org.apache.commons.digester.Digester.getParser(Digester.java:786)
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1785)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2528)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:5006)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4930)
at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:5118)
at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1283)
at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:848)
at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:435)
at com.evermind.server.Application.getHttpApplication(Application.java:592)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:2280)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:2199)
at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:701)
at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:308)
at com.evermind.server.http.HttpServer.setSites(HttpServer.java:280)
at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:180)
at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2541)
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1058)
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:131)
at java.lang.Thread.run(Thread.java:595)
Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency. 08:18:10,802 ERROR ActionServlet(398)
java.lang.NullPointerException
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1785)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2528)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:5006)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4930)
at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:5118)
at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1283)
at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:848)
at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:435)
at com.evermind.server.Application.getHttpApplication(Application.java:592)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:2280)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:2199)
at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:701)
at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:308)
at com.evermind.server.http.HttpServer.setSites(HttpServer.java:280)
at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:180)
at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2541)
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1058)
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:131)
at java.lang.Thread.run(Thread.java:595)
Digester.getParser: 08:18:20,228 ERROR Digester(789)
java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
at javax.xml.parsers.SAXParserFactory.setXIncludeAware(SAXParserFactory.java:390)
at org.apache.commons.digester.Digester.getFactory(Digester.java:534)
at org.apache.commons.digester.Digester.getParser(Digester.java:786)
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1785)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2528)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:5006)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4930)
at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:3139)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:775)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:226)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:127)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:116)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency. 08:18:20,231 ERROR ActionServlet(398)
java.lang.NullPointerException
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1785)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2528)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:5006)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4930)
at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:3139)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:775)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:226)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:127)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:116)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
当我尝试使用 xml 模式验证 xml 文件时,我遇到了这个问题。我用谷歌搜索并找到了这个问题的根本原因。
Jar 文件,例如 xerces-2.6.2.jar、crimson.jar、xalan.jar
jaxp.jar 具有旧版本的 SAXParserFactory。所以上面所有的jar
文件应该从类 parh 中删除。
根据具有正确版本的 jar 删除或更新 jar。
I faced this issue when i tried to validate xml file using xml schema. I googled and found out the root cause for this issue.
Jar files like xerces-2.6.2.jar, crimson.jar, xalan.jar along
with jaxp.jar has older version SAXParserFactory. So all the above jar
files should be removed from class parh.
Remove or update jar based on its jars with correct version.
如果它对任何人有帮助:我遇到了类似的问题,并且提供 SaxParserFactory 作为 JVM 选项是有效的
If it helps anyone : I had a similar issues and providing the SaxParserFactory as a JVM option worked
使用 Commons Digester 1.7,而不是 JDeveloper 附带的 Commons Digester。
http://jakarta.apache.org/commons/digester/
Use Commons Digester 1.7, instead of the Commons Digester that is included with JDeveloper.
http://jakarta.apache.org/commons/digester/
就我而言,我将 commons-digester 从 2.1 降级到 1.8 并且工作正常。
In my case, i have dowgrade commons-digester from 2.1 to 1.8 and work fine.
没关系,我没有配置 OC4J 的 global-web-application.xml 来首先搜索本地类,也没有创建自定义 orion-web.xml 文件来执行相同的操作。
如果遇到此问题,最简单(大锤)的方法是将以下行添加到 (oc4j dir)\j2ee\home\config\global-web-application.xml:
问题是,如果您尝试使用 Xerces 或其他最新的 SAX 解析器,您将遇到类路径问题甲骨文试图强迫你接受(就像他们的任何产品一样)。
Never mind, I hadn't configured OC4J's global-web-application.xml to search local classes first or created a custom orion-web.xml file to do the same thing.
If you run into this issue, the easiest (big hammer) approach is to add this line to (oc4j dir)\j2ee\home\config\global-web-application.xml:
<web-app-class-loader search-local-classes-first="true"/>
The problem is that if you try to use Xerces or another somewhat up-to-date SAX parser, you'll run into a classpath issue with the one Oracle tries to force down your throat (same as with any of their products).