<转>Servlet.init() for servlet action threw exception 异常解决办法

tomcat 经常会报一些莫名其妙的异常:如下 

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet.init() for servlet action threw exception org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) java.lang.Thread.run(Thread.java:595)

 

root cause

java.lang.NullPointerException org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1003) org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955) org.apache.struts.action.ActionServlet.init(ActionServlet.java:482) com.dc.idm.ui.action.init.InitServlet.init(InitServlet.java:68) javax.servlet.GenericServlet.init(GenericServlet.java:211) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) java.lang.Thread.run(Thread.java:595)

 

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.

 

这个问题主要是由于配置文件对应不上造成的,也就是说你的web.xml文件中关于struts的配置说明( struts -[*-config.xml])在指定的目录下没找到造成的,如:

 

<init-param>
            <param-name>config/console/workflow</param-name>
            <param-value>
                /WEB-INF/struts-conf/struts-flow.xml
            </param-value>
        </init-param>

 

 

而在       /WEB-INF/struts-conf/struts-flow.xml 下并没有找到 struts-flow.xml文件,此时,就会报这个错!!请校正~

你可能感兴趣的:(exception)