java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
Solution 1
The javax.servlet.jsp.tagext.TagLibraryValidator class is introduced in JSP 2.0. This error can thus have the following possible causes:
You are not running a JSP 2.0 compatible serlvetcontainer. For example, Tomcat 4.x or 5.0. You need at least Tomcat 5.5 or better, 6.0, or even better, 7.0. Just the latest version.
You have cluttered the
/WEB-INF/lib
with arbitrarily downloadedjsp-api.jar
orj2ee.jar
files or whatever contains the JSP API, which originates from a completely different servletcontainer make/version which in turn was actually not JSP 2.0 compliant. Get rid of those libraries. You don't need them. If you did this to workaround compilation errors, then you did it the wrong way. They should end up in compiletime classpath, not in the runtime classpath. See also How do I import the javax.servlet API in my Eclipse project?
Solution 2
I had a similar problem, I am using Tomcat 10. I was getting this error using Apache NetBeans 12.3 IDE.
I added the following libraries:
My code is running fine now. link to see where I added them
Related videos on Youtube
user1031152
Updated on July 05, 2022Comments
-
user1031152 almost 2 years
I followed the guide in this link to install JSTL but I got the following error when I tried to launch my JSP page:
java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
The taglib declaration is:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
I installed JSTL 1.1 under
/WEB-INF/lib
in Tomcat webapps and tried to do the same in my project, but it didn't work. I also tried version 1.2 of JSTL and still the same message. How is this caused and how can I solve it? -
ajinzrathod almost 3 yearsThis solved my problem but tags such as
<c:forEach>
are not working. -
Agung Sudrajat over 2 yearssolved my problem, but not working when updating database such as update, insert, delete, etc
-
Ashish Augustine almost 2 years<c:forEach> is working for me