' java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator

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?



Solution 1:[1]

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:

  1. jakarta.servlet.jsp.jstl-api-2.0.0.jar
  2. jakarta.servlet.jsp.jstl-2.0.0 (1).jar

My code is running fine now. link to see where I added them

Solution 2:[2]

I had the same problem. Use the WildFly server latest one. This resolved my the same issue.

Solution 3:[3]

Download all the required jar files from here. While adding the jar files, don't include the jakarta.servlet-api-5.0.0.jar file, which is already included in the Tomcat10.0

This will work not only for the basic JSTL functions, but also for iterations using tags such as <c:forEach>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 pallavi
Solution 2 Pawan Kumar
Solution 3 Ashish Augustine