Upgrading JSTL 1.1 to 1.2 fails with java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext

后端 未结 2 1555
耶瑟儿~
耶瑟儿~ 2021-01-27 14:43

i getting error when i using JSTL. Please to help me.

i using jstl-impl-1.2.jar and jstl-api-1.2.jar in my tomcat 7 and i take out standard.jsp and jstl.jsp but still hi

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-27 15:02

    Your /WEB-INF/lib, or worse, your JRE/lib or JRE/lib/ext, is polluted with servletcontainer-specific libraries like jsp-api.jar of a different and older-versioned servletcontainer make/version. You need to get rid of them in your webapp's /WEB-INF/lib. Those libraries are supposed to be already provided by the servletcontainer itself, which is in your case Tomcat.

    In your particular example, the javax.servlet.jsp.PageContext.getELContext() method, which exist since JSP 2.1 only, is requested by Tomcat's internal classes, but it could not be found in the JSP API, because you've an older versioned one (apparently JSP 2.0 or older) in your webapp which got precedence in classloading over Tomcat's own one.

    In other words, your Tomcat 7 was running like as tomcat 5.5 or older all the time until you upgraded JSTL to a Tomcat 6 compatible one.

    See also:

    • How do I import the javax.servlet API in my Eclipse project?

提交回复
热议问题