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

  • 4299
  • 0
  • JSP
  • 2011-01-21

HTTP Status 500 description The server encountered an internal error () that prevented it from fulfilling this request.java.lang.NoSuchMethodError

在IE下使用Tomcat 6.0 執行JSP檔時發生下述錯誤:

 

HTTP Status 500 -


type Exception report

message

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

exception

javax.servlet.ServletException: java.lang.NoSuchMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:275)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

 

root cause

java.lang.NoSuchMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
	org.apache.jsp.CH4.ErrorPage_jsp._jspInit(ErrorPage_jsp.java:28)
	org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
	org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 

-------------------------------------------------------------------------------------

請依照下述解決方式來問題排除,

1.開啟 {Tomcat_Install}\lib 資料夾

  開啟 {Tomcat_Install}\webapps\網站\WEB-INF\lib 資料夾

 

2.對照兩個資料夾內是否有重複的jar檔,若有的話則刪除

  {Tomcat_Install}\webapps\網站資料夾\WEB-INF\lib 資料夾內的jar檔。

  (我在此資料夾發現重覆的檔案為jsp-api.jar和servlet-api.jar)

 

3.重新啟動Tomcat,再將jsp網頁開啟將正常顯示。

 

 

參考或是複製語法時,別忘了留個言喔 ^ ^ ~