jsp報錯
JasperExceptionClassNotFoundException
最近在部署一個J2EE工程時,報如下異常:
Java程式碼
org.apache.jasper.JasperException: java.lang.ClassNotFoundException
詳細情況如下:
Java程式碼
(1)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
(2)九月 06, 2012 10:30:42 上午 org.apache.catalina.core.ApplicationDispatcher invoke
嚴重: Servlet.service() for servlet jsp threw exception
(3)九月 06, 2012 10:30:42 上午 org.apache.catalina.core.StandardWrapperValve invoke
嚴重: Servlet.service() for servlet [default] in context with path [/JetsenPublishNewsServer] threw exception [org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.web.main_jsp] with root cause
專案用的是SSH框架,同樣是在SVN上下載的,別人的沒問題,在花了半個下午沒解決後,後來想想,可能是以下幾個原因
(1)配置檔案出問題
(2)部分jar包沒導進去
(3)tomcat版本問題
在排除了前兩個問題之後,今天把tomcat的版本由7.0改成6.0問題居然解決了,可能是7.0的版本有些功能向下不相容的緣故。
關於org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/j
SUNJSPJavaJ#Apache
此問題一般是因為jar(jstl.jar,和standard.jar) 導致的問題:
第一種:
就是在Eclipse的工程中匯入JSTL.jar 和 standard.jar
第二種:
修改web.xml,加上下面的語句:
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/xml</taglib-uri>
<taglib-location>/WEB-INF/x.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/sql</taglib-uri>
<taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>
</jsp-config>
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be res
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
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:149)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:386)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:450)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1397)
at org.apache.jasper.compiler.Parser.parse(Parser.java:130)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:595)
解決:web專案出現如上問題,據查是版本問題:
JSTL 1.0 的宣告是:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core " %>
JSTL1.1 的宣告是:
< %@ taglib prefix="c" uri=http://java.sun.com/jsp/jstl/core %>
專案中,已經是 jstl 1.2 版本了,頁面中也全部是用<%@ taglib prefix="c" uri=http://java.sun.com/jsp/jstl/core %>這種方式。javaee5之後就只有 jstl.jar 這一個jar包了,沒有standard.jar包,tld檔案也打包到jar裡面去了,在web.xml檔案裡配置jsp-config的解決方式也 是浮雲。
最終解決方法:
jstl.jar 包在ide專案中有,但在tomcat釋出的應用WEB-INF/lib下沒有,這是工具釋出專案的問題,複製一個jar包過去問題就解決了。
最近在部署一個J2EE工程時,報如下異常:
Java程式碼
org.apache.jasper.JasperException: java.lang.ClassNotFoundException
詳細情況如下:
Java程式碼
(1)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
(2)九月 06, 2012 10:30:42 上午 org.apache.catalina.core.ApplicationDispatcher invoke
嚴重: Servlet.service() for servlet jsp threw exception
(3)九月 06, 2012 10:30:42 上午 org.apache.catalina.core.StandardWrapperValve invoke
嚴重: Servlet.service() for servlet [default] in context with path [/JetsenPublishNewsServer] threw exception [org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.web.main_jsp] with root cause
專案用的是SSH框架,同樣是在SVN上下載的,別人的沒問題,在花了半個下午沒解決後,後來想想,可能是以下幾個原因
(1)配置檔案出問題
(2)部分jar包沒導進去
(3)tomcat版本問題
在排除了前兩個問題之後,今天把tomcat的版本由7.0改成6.0問題居然解決了,可能是7.0的版本有些功能向下不相容的緣故。
關於org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/j
SUNJSPJavaJ#Apache
此問題一般是因為jar(jstl.jar,和standard.jar) 導致的問題:
第一種:
就是在Eclipse的工程中匯入JSTL.jar 和 standard.jar
第二種:
修改web.xml,加上下面的語句:
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/xml</taglib-uri>
<taglib-location>/WEB-INF/x.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/sql</taglib-uri>
<taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>
</jsp-config>
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be res
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
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:149)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:386)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:450)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1397)
at org.apache.jasper.compiler.Parser.parse(Parser.java:130)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:595)
解決:web專案出現如上問題,據查是版本問題:
JSTL 1.0 的宣告是:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core " %>
JSTL1.1 的宣告是:
< %@ taglib prefix="c" uri=http://java.sun.com/jsp/jstl/core %>
專案中,已經是 jstl 1.2 版本了,頁面中也全部是用<%@ taglib prefix="c" uri=http://java.sun.com/jsp/jstl/core %>這種方式。javaee5之後就只有 jstl.jar 這一個jar包了,沒有standard.jar包,tld檔案也打包到jar裡面去了,在web.xml檔案裡配置jsp-config的解決方式也 是浮雲。
最終解決方法:
jstl.jar 包在ide專案中有,但在tomcat釋出的應用WEB-INF/lib下沒有,這是工具釋出專案的問題,複製一個jar包過去問題就解決了。
相關文章
- 很奇怪的jsp錯誤,大家試試看報錯不JS
- 報錯資訊 The jsp:param action must not be used outside the jsp:include, jsp:forward, or jsp:params elements 的原因及解決辦法JSIDEForward
- Jsp Unescaped xml character報錯的解決辦法JSXML
- jsp頁面引入css檔案報錯javax.servletcannotberesolvedtoatypeJSCSSJavaServlet
- JSP筆記-除錯JS筆記除錯
- 關於jsp呼叫ejb出錯的jsp程式如下JS
- jsp中的錯誤1JS
- <%@ taglib prefix=“c“ uri=“http://java.sun.com/jsp/jstl/core“ %>報錯HTTPJavaJS
- 關於EL在JSP內呼叫RequestScope內建物件報錯的問題JS物件
- 【錯誤】 Unable to compile class for JSPCompileJS
- 求救!!!!!!jsp執行錯誤;(轉)JS
- 使用jsp:useBean的時候出錯!JSBean
- 版主求救:Jbuilder編譯Jsp出錯UI編譯JS
- JavaScript報錯型別(報錯速查)JavaScript型別
- 安裝jive 後,post.jsp 出錯JS
- 請教,struts中jsp編譯錯誤JS編譯
- 自定義jsp中的錯誤頁面JS
- 如何解決在eclipse中maven工程中建立index.jsp上面的報錯問題EclipseMavenIndexJS
- 線上急等]訪問jsp時的錯誤JS
- [求助]jsp+javaBean除錯環境問題!JSJavaBean除錯
- JavaScript報錯JavaScript
- spark報錯Spark
- mybatis報錯MyBatis
- redis報錯Redis
- 報錯+2
- playsound報錯
- 前端報錯前端
- dhcp報錯
- 報錯集
- springcloud報錯報UnsatisfiedDependencyExceptionSpringGCCloudException
- asm報錯一例-support 報錯rename failedASMAI
- jb7 怎樣才能除錯 jsp檔案除錯JS
- 在JBuilder7中除錯Jive中的JspUI除錯JS
- flutter路由報錯Flutter路由
- pycharm import 報錯PyCharmImport
- 埠占用報錯
- webpack build報錯WebUI
- oracle dg報錯Oracle