The following error is generated when using jstl with tomcat10.
HTTP status 500 – Internal server error
Type Exception Report
Message java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
Description The server encountered an unexpected condition that prevented it from completing the request.
Exceptions
jakarta.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) Reason java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator java.base/java.lang.ClassLoader.defineClass1(Native Method) java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2516) org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:872) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1408) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1252) java.base/java.lang.ClassLoader.defineClass1(Native Method) java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2516) org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:872) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1408) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1252) org.apache.jasper.compiler.TagLibraryInfoImpl.createValidator(TagLibraryInfoImpl.java:355) org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:195) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:487) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444) org.apache.jasper.compiler.Parser.parse(Parser.java:138) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244) org.apache.jasper.compiler.ParserController.parse(ParserController.java:105) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:206) org.apache.jasper.compiler.Compiler.compile(Compiler.java:391) org.apache.jasper.compiler.Compiler.compile(Compiler.java:367) org.apache.jasper.compiler.Compiler.compile(Compiler.java:351) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328) jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) Reason java.lang.ClassNotFoundException: javax.servlet.jsp.tagext.TagLibraryValidator org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1444) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1252) java.base/java.lang.ClassLoader.defineClass1(Native Method) java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2516) org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:872) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1408) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1252) java.base/java.lang.ClassLoader.defineClass1(Native Method) java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2516) org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:872) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1408) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1252) org.apache.jasper.compiler.TagLibraryInfoImpl.createValidator(TagLibraryInfoImpl.java:355) org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:195) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:487) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444) org.apache.jasper.compiler.Parser.parse(Parser.java:138) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244) org.apache.jasper.compiler.ParserController.parse(ParserController.java:105) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:206) org.apache.jasper.compiler.Compiler.compile(Compiler.java:391) org.apache.jasper.compiler.Compiler.compile(Compiler.java:367) org.apache.jasper.compiler.Compiler.compile(Compiler.java:351) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328) jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ): Note that the full stack information for the main issue can be viewed in the server logs Apache Tomcat/10.0.16
Solution (I):
If you are using tomcat10 version need to change tomcat10 to tomcat8
Solution (II):
Tomcat10 version needs to be used with :
jakarta.servlet.jsp.jstl-2.0.0.jar
jakarta.servlet.jsp.jstl-api-2.0.0.jar
Note: Only these two jstl packages are allowed under lib, no other jstl packages, otherwise it will still report an error
Read More:
- [Solved] nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
- Error resolution: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/Datatype
- Maven project running servlet jump JSP error: HTTP status 500 – unable to compile class for JSP
- [Solved] No validator could be found for constraint ‘javax.validation.constraints.NotBlank’ validating type ‘java.lang.String’
- [Solved] Java.lang.ClassCastException: [Ljava.lang.Long; cannot be cast to java.util.List
- [Solved] fasterxml ToStringSerializerBase Error: Caused by: java.lang.NoClassDefFoundError…
- [Solved] defineClass Error: java.lang.NoClassDefFoundError: Illegal:
- [Solved] MultipartException: Failed to parse multipart servlet request; nested exception is java.lang.Runtime
- [Solved] Linux java -jar Start Project Error: Unsupported major.minor version 52.0
- [Solved] IDEA springboot Startup Error: java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path
- Solve the use of declaration transactions in spring java.lang.NoClassDefFoundError: org/aspectj/util/PartialOrder$PartialComparable
- [Solved] qrcode-error: Exception in thread “main” java.lang.NoClassDefFoundError…
- [Solved] Hibernate Error: java.lang.StackOverflowError at java.lang.Integer.toString(Integer.java:402)
- [Solved] IDEA Add maven Project Error: Error:(3,21)java: Package javax.servletdoes not exist
- [Solved] nacos Startup Error: nested exception is java.lang.RuntimeException: java.lang.RuntimeException: [db-load-error
- [Solved] JSP tag forwarding forword error: org.apache.jasper.JasperException
- [Solved] javax.servlet.ServletException: Servlet[springmvc] Servlet.init()
- [Solved] java Internal error in the mapping processor java.lang.NullPointerException
- [Solved] java Internal error in the mapping processor java.lang.NullPointerException
- [Solved] Maven Project Error: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener