• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;

 
Shareef Uddin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello,

I am getting error msg:

-----------------------------
type Exception report

message

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

exception

javax.servlet.ServletException: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.customtags.ForEachTag_jsp._jspService(ForEachTag_jsp.java:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


root cause

java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
javax.servlet.jsp.jstl.core.LoopTagSupport.unExposeVariables(LoopTagSupport.java:587)
javax.servlet.jsp.jstl.core.LoopTagSupport.doFinally(LoopTagSupport.java:323)
org.apache.jsp.customtags.ForEachTag_jsp._jspx_meth_c_forEach_0(ForEachTag_jsp.java:110)
org.apache.jsp.customtags.ForEachTag_jsp._jspService(ForEachTag_jsp.java:62)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


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

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

And I have el-api.jar and jsp-api-2.1-6.0.0.jar files in my WEB-INF/lib folder.


web.xml
----------

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>foreach</servlet-name>
<jsp-file>/customtags/ForEachTag.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>foreach</servlet-name>
<url-pattern>/foreach</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
<taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>
</web-app>

ForEach.jsp
--------------

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<c:forEach var="i" begin="1" end="10">
<cut value="${i}" />
</c:forEach>

Please help me in fixing the above error.

Thank you,
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove those jar files from WEB-INF/lib. Where did you get them from? The JSP API is provided by the container that you are using -- you should not copy them into your web app.
 
Shareef Uddin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thank you very much. Problem solved!!!

I removed jsp-api-1.2.0 file from WEB/lib.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic