简体   繁体   中英

org.apache.jasper.JasperException

When i open first time my application its show error like

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.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:183)
    org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:125)
    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)

But i refreshed again then it will open fine without error.

What is the problem and how to fix this?

Please can any one help me...

it looks like your application requires some initialization of code which takes time. now while you open the page it is initializing things in background and you see error due to uninitialized or partial initialized values.

you can add some auto initializers or wait for some time to get it loaded completely.

I met this problem because of web.xml misconfiguration.

I tried to add *.jar to be served by JspServlet.

You certainly did an error in Servlet mapping in your web.xml.

Here's an extract of relevance of the JspServletWrapper#handleJspException() source.

456         // If the line number is less than one we couldn't find out
457         // where in the JSP things went wrong
458         int jspLineNumber = detail.getJspBeginLineNumber();
459         if (jspLineNumber < 1) {
460             throw new JasperException(ex);
461         }

Apparently the JSP was empty on first access. What frameworks are you using? I haven't seen a framework before which autogenerates JSP files on startup or something like that. It might need some configuration finetuning.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM