簡體   English   中英

“絕對 uri:http://java.sun.com/jstl/core 無法解析”

[英]“The absolute uri: http://java.sun.com/jstl/core cannot be resolved”

我一直在搜索 web 以找到適合我情況的確切原因/解決方法。 我訪問了本網站上的這些其他鏈接:

如何安裝 JSTL? 絕對uri:http://java.sun.com/jstl/core 無法解析

https://stackoverflow.com/tags/jstl/info

JSTL 1.2 絕對uri:http://java.sun.com/jsp/jstl/core 無法解析

當我嘗試為我的網站構建戰爭文件時,仍然出現同樣的錯誤。 早些時候它在 Tomcat 8.5.35 上工作。 我已將其更新為 Tomcat 9.0.37,這一切都付諸東流。 我已經更新了構建路徑,環境變量。 我已確保所有其他文件(例如我的庫和框架文件)也已更新。 我已確保 build.properties 文件具有正確的 tomcat 版本。 在 WEB-INF/web.xml 文件中,我已將 servlet 更新為 4.0,因為 Tomcat 9 支持。 我在 WEB-INF/lib 文件夾中添加了 jstl1.2.jar 以及我的站點需要的其他 jars。

例外:

 [jasper] Jul 20, 2020 3:11:08 PM org.apache.jasper.servlet.TldScanner scanJars
   [jasper] INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
   [jasper] Jul 20, 2020 3:11:10 PM org.apache.jasper.JspC execute
   [jasper] SEVERE: Compilation error
   [jasper] java.util.concurrent.ExecutionException: org.apache.jasper.JasperException: The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
   [jasper]     at java.util.concurrent.FutureTask.report(FutureTask.java:122)
   [jasper]     at java.util.concurrent.FutureTask.get(FutureTask.java:192)
   [jasper]     at org.apache.jasper.JspC.execute(JspC.java:1529)
   [jasper]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
   [jasper]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
   [jasper]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   [jasper]     at java.lang.reflect.Method.invoke(Method.java:498)
   [jasper]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
   [jasper]     at org.apache.tools.ant.Task.perform(Task.java:350)
   [jasper]     at org.apache.tools.ant.Target.execute(Target.java:449)
   [jasper]     at org.apache.tools.ant.Target.performTasks(Target.java:470)
   [jasper]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
   [jasper]     at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
   [jasper]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
   [jasper]     at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:36)
   [jasper]     at org.apache.tools.ant.Project.executeTargets(Project.java:1254)
   [jasper]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:460)
   [jasper]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:142)
   [jasper] Caused by: org.apache.jasper.JasperException: The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
   [jasper]     at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:55)
   [jasper]     at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:294)
   [jasper]     at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:81)
   [jasper]     at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:251)
   [jasper]     at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:122)
   [jasper]     at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:431)
   [jasper]     at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:489)
   [jasper]     at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1445)
   [jasper]     at org.apache.jasper.compiler.Parser.parse(Parser.java:144)
   [jasper]     at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
   [jasper]     at org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
   [jasper]     at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:206)
   [jasper]     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:386)
   [jasper]     at org.apache.jasper.JspC.processFile(JspC.java:1362)
   [jasper]     at org.apache.jasper.JspC$ProcessFile.call(JspC.java:1886)
   [jasper]     at org.apache.jasper.JspC$ProcessFile.call(JspC.java:1877)
   [jasper]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   [jasper]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   [jasper]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   [jasper]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   [jasper]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   [jasper]     at java.lang.Thread.run(Thread.java:748)
   [jasper] Error count: [1]

BUILD FAILED

拋出異常的碧玉“-compile-jsp”(來自我的 build.xml 文件)

<jasper validateXml="false" uriroot="${build.dir}/jspsrc" 
                webXmlFragment="${build.dir}/jspsrc/generated_web.xml" 
                outputDir="${build.dir}/jspjava" 
                xpoweredby="false" addwebxmlmappings="true"
                erroronusebeaninvalidclassattribute="false"
                compilersourcevm="${javac.version}" compilertargetvm="${javac.version}" />

我的 WEB-INF 的開始

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
  version="4.0">

在網站上加載的第一個頁面是一個同意橫幅(DoD 網站),在這里 (consent.jsp) 我有以下行:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

[編輯] 如果我刪除它成功構建的這條線,這是一個問題嗎?

我正在使用 Eclipse ...

如果您想看其他東西,請告訴我,請發送幫助!

回答我自己的問題,它僅在我將 JSTL 1.2 jar 打包到 tomcat 本身的 lib 文件夾中時才有效。

謝謝

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM