user647956
user647956

Reputation: 71

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.

Upvotes: 7

Views: 122993

Answers (4)

alessia
alessia

Reputation: 1

if may help: i've the same issue with a simple html page that do a select* from a postgres table.

The issue was that i've imported my external library by build path but in the webContent file result missed all the library i imported.

I do a "brute force" XD copy and paste of the jars (postgresSql jdbc and catalina root for tomcat server) on: Web-inf -> lib ... and now it works!

I don't know if it is an elegant way to solve the issue but it works!

Upvotes: 0

MoheeBoy
MoheeBoy

Reputation: 1

In my case the error was shown because my Class attributes and table attributes mismatched.

I am working in Hibernate.

So if your case is same as mine, possible solution could be:

  1. Edit your .java file
  2. Edit your .hbm.xml file
  3. Delete the table which has been already created in your database.
  4. Re-run the project

If still its not working, you must check the values entered in your object. Ex: if you have declared an attribute as string then it should contain string object only.

Note: Hibernate creates the table itself. So no need to create table manually.

Upvotes: 0

user1316369
user1316369

Reputation: 51

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.

Upvotes: 4

BalusC
BalusC

Reputation: 1108722

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.

Upvotes: 7

Related Questions