Showing posts with label JasperException. Show all posts
Showing posts with label JasperException. Show all posts

Thursday, May 10, 2012

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

If you get below mentioned error

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
 org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:53)
 org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
 org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
 org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:310)
 org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:152)
 org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
 org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
 org.apache.jasper.compiler.Parser.parseElements(Parser.java:1425)
 org.apache.jasper.compiler.Parser.parse(Parser.java:138)
 org.apache.jasper.compiler.ParserController.doParse(ParserController.java:239)
 org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
 org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:197)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:372)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:339)
 org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
 org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
 org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
 org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
 org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
 org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

Probably the reason could be you have used below mentioned taglib in your JSP file.

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

You need to get the right version of JSTL in your application's classpath, they use different URIs. If that one's not working, try downloading JSTL 1.2 (jstl-1.2.jar) from http://download.java.net/maven/1/jstl/jars/jstl-1.2.jar, or pull down the 1.1 JSTL jars.

To know more about JSTL Taglib, Please see below links.
http://docs.oracle.com/javaee/5/tutorial/doc/bnake.html
http://jakarta.apache.org/taglibs/doc/standard-doc/GettingStarted.html

Thursday, October 27, 2011

org.apache.jasper.JasperException: Unable to compile class for JSP

I got this error while working with a complex file  in JBOSS.

If you get below mentioned error, As the compiler suggesting there is some brace mismatch. Just go around and check again. Make sure you close all braces correctly.

09:09:25,282 ERROR [ContainerBase] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 822 in the generated java file
Syntax error, insert "else Statement" to complete IfStatement

An error occurred at line: 822 in the generated java file
Syntax error, insert "}" to complete Block

An error occurred at line: 832 in the generated java file
Syntax error on token "}", delete this token

An error occurred at line: 833 in the generated java file
Syntax error, insert "}" to complete ClassBody

Friday, September 2, 2011

org.apache.jasper.JasperException

While migration of my code from WebSphere to JBoss i observed below mentioned error.


04:17:20,946 ERROR [ContainerBase] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /com/test.jsp(15,1) Expecting "jsp:param" standard action with "name" and "value" attributes
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
at org.apache.jasper.compiler.Parser.parseParam(Parser.java:827)
at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1665)
at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1004)
at org.apache.jasper.compiler.Parser.parseForward(Parser.java:868)
at org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1120)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1448)
at org.apache.jasper.compiler.Parser.parse(Parser.java:133)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)

Solution :

Replace old code

<jsp:include flush="true" page="file.jsp">
</jsp:include>
OR
<jsp:forward page="file.jsp">
</jsp:forward>


With new code

<jsp:include flush="true" page="file.jsp"/>
OR
<jsp:forward page="file.jsp"/>