It's not a secret anymore!*
The moose likes JSP and the fly likes java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext; " Watch "java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext; " New topic
Author

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

Shareef Uddin
Greenhorn

Joined: Feb 06, 2011
Posts: 8

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

Joined: Jan 10, 2002
Posts: 60041
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Shareef Uddin
Greenhorn

Joined: Feb 06, 2011
Posts: 8

Thank you very much. Problem solved!!!

I removed jsp-api-1.2.0 file from WEB/lib.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
 
Similar Threads
what is this error
I have got this error when i try to run my spring web project.... what is this error?
retreiving String array from servlet
iterating a list in jstl using foreach causes exception
Error in Struts Application(Cannot find message resources under key org.apache.strut)