Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org.apache.jasper.JasperException

when i open first time website its show error like this

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:130)
    org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
    org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
    org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)

root cause

java.lang.NullPointerException
    org.apache.jsp.index_jsp._jspService(index_jsp.java:73)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:130)
    org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
    org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
    org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.

but if i refresh then site will open perfectly but if u leave idle sometime then if u open next then also same error after that if u refresh then site open perfect this is the problem, its applying in entire application in any page.

like image 796
user647956 Avatar asked Dec 28 '22 00:12

user647956


2 Answers

java.lang.NullPointerException org.apache.jsp.index_jsp._jspService(index_jsp.java:73)

Go to the Tomcat /work/Catalina/localhost folder, then open the folder matching the webapp context name, then open /org/apache/jsp/index_jsp.java file and read line 73. Backtrack this line to your own original index.jsp file in the web root and fix it accordingly.

Or if the particular code line is in no way to be backtracked to your own code and is thus specific to the servletcontainer's own JspServlet, then it's likely a bug or misconfiguration. Update your question to include it so that we can assist you further with this. Don't forget to mention the exact Tomcat version.

like image 171
BalusC Avatar answered Jan 13 '23 12:01

BalusC


In my case it was this line in jsp:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"pageEncoding="ISO-8859-1"%>

Make sure there is a space between: " and the next attribute.

like image 22
user1316369 Avatar answered Jan 13 '23 13:01

user1316369