本文主要是介绍转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文件,此时,就会报这个错!!请校正~
这篇关于转Servlet.init() for servlet action threw exception 异常解决办法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!