jakartaee / tags

Other
25 stars 28 forks source link

Unable to find taglib [c] for URI: [jakarta.tags.core]. Tomcat 10.1.13 #250

Closed pavlo-yashchuk closed 1 year ago

pavlo-yashchuk commented 1 year ago

Hi, thanks for the attention Im trying to migrate to spring 6 and tomcat 10.1.13 but encountered many obstacles along the way. One of them is jsp. As far as I understood, it cannot resolve the path for the tag. According to the documentation for version 3, I changed all the tags from http://java.sun.com/jsp/jstl/core to jakarta.tags.core, added various dependencies and got the error below.

my dependecies:

implementation 'org.mortbay.jasper:apache-jsp:10.1.7'
implementation 'jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:3.0.0'
implementation 'org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.1'
implementation("org.apache.tomcat:tomcat-jsp-api:10.1.13")
compileOnly "jakarta.servlet:jakarta.servlet-api:6.0.0"

also tried add additional dependecies for resolve problem, but it didnt help

compileOnly 'jakarta.platform:jakarta.jakartaee-api:10.0.0'
implementation 'jakarta.servlet.jsp:jakarta.servlet.jsp-api:3.1.1'
implementation 'jakarta.el:jakarta.el-api:5.0.1'

what im doing wrong? or for what I forgot? with java ee and tomcat 9 it was easy ) error:

org.apache.jasper.JasperException:` Unable to find taglib [c] for URI: [jakarta.tags.core]
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:54)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:294)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:81)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:176)
    at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429)
    at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:487)
    at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
    at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:245)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:106)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:211)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:396)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:372)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:396)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
pavlo-yashchuk commented 1 year ago

The problem was in context.xml I have specific tld scanner inside block after changing to new jar naming tldScan="jakarta.servlet.jsp.jstl*.jar" all works image