2010-01-20 71 views
0

我試圖啓動一個使用OC4J版本10.1.3.5的Struts 1.X(版本1.3.10)應用程序。應用程序設法初始化所有Spring bean,包括在action-servlet.xml中定義的Struts動作。但是,一旦所有的bean都被初始化,我會在日誌中看到一個相當醜陋的例外。Struts 1.3.10 Digester.getParser()UnsupportedOperationException

我懷疑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) 

回答

0

沒關係,我還沒有配置OC4J的全球網絡application.xml中先搜索本地類或創建一個自定義的orion-web.xml文件中做同樣的事情。

如果遇到這個問題,最簡單的(大鐵錘)的方法是加入這一行(OC4J目錄)\ J2EE \家\ CONFIG \全球網絡的application.xml:

<web-app-class-loader search-local-classes-first="true"/>

問題是,如果您嘗試使用Xerces或其他稍微更新的SAX解析器,那麼您將遇到類路徑問題,其中一個Oracle試圖強制您的喉嚨(與其任何產品相同) 。

3

我在使用xml模式驗證xml文件時遇到了這個問題。我搜索了一下,發現了這個問題的根源。

喜歡的xerces-2.6.2.jar,的crimson.jar,xalan.jar沿 用的jaxp.jar Jar文件有舊版本的SAXParserFactory。所以上述所有jar 文件應該從類parh中刪除。

刪除或更新基於罐子與正確版本的jar。

+0

是的,這是我的老一套,但自從轉換到Weblogic後,我遇到了同樣的問題。基本上,首先要嘗試的是將xml-apis設置爲在pom.xml中提供了。 – Jason

4

如果有幫助的人:我也有類似的問題,並提供了作爲SAXParserFactory的JVM選項工作

-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl 
相關問題