加载jsp页面报错

各位大侠看看这个错误,报错不影响使用,但看着不爽
10:14:34.957 [http-8080-1] DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: 13181264749
10:14:34.956 [http-8080-2] DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: 13181264749
10:14:34.957 [http-8080-1] DEBUG c.o.x.c.i.InstantiatingNullHandler - Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@156ead7], property=struts]
10:14:34.957 [http-8080-2] DEBUG c.o.x.c.i.InstantiatingNullHandler - Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@156ead7], property=struts]
10:14:34.957 [http-8080-1] DEBUG o.s.o.h.s.OpenSessionInViewFilter - Closing single Hibernate Session in OpenSessionInViewFilter
10:14:34.957 [http-8080-1] DEBUG o.s.o.hibernate3.SessionFactoryUtils - Closing Hibernate Session
10:14:34.957 [http-8080-2] DEBUG o.s.o.h.s.OpenSessionInViewFilter - Closing single Hibernate Session in OpenSessionInViewFilter
10:14:34.957 [http-8080-2] DEBUG o.s.o.hibernate3.SessionFactoryUtils - Closing Hibernate Session
2011-10-9 10:14:34 org.apache.catalina.core.ApplicationDispatcher invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.error_002dpage_jsp._jspService(error_002dpage_jsp.java:82)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:416)
at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
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:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
2011-10-9 10:14:34 org.apache.catalina.core.StandardHostValve custom
严重: Exception Processing ErrorPage[errorCode=404, location=/error-page.jsp]
org.apache.jasper.JasperException: java.lang.NullPointerException
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:416)
at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
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:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at org.apache.jsp.error_002dpage_jsp._jspService(error_002dpage_jsp.java:82)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
... 19 more
10:14:34.959 [http-8080-3] DEBUG o.s.o.h.s.OpenSessionInViewFilter - Using SessionFactory 'sessionFactory' for OpenSessionInViewFilter
10:14:34.960 [http-8080-3] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sessionFactory'
10:14:34.960 [http-8080-3] DEBUG o.s.o.h.s.OpenSessionInViewFilter - Opening single Hibernate Session in OpenSessionInViewFilter
10:14:34.960 [http-8080-3] DEBUG o.s.o.hibernate3.SessionFactoryUtils - Opening Hibernate Session
10:14:34.960 [http-8080-3] DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: 13181264749
10:14:34.960 [http-8080-3] DEBUG c.o.x.c.i.InstantiatingNullHandler - Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@156ead7], property=struts]
10:14:34.961 [http-8080-3] DEBUG o.s.o.h.s.OpenSessionInViewFilter - Closing single Hibernate Session in OpenSessionInViewFilter
10:14:34.961 [http-8080-3] DEBUG o.s.o.hibernate3.SessionFactoryUtils - Closing Hibernate Session
2011-10-9 10:14:34 org.apache.catalina.core.ApplicationDispatcher invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.error_002dpage_jsp._jspService(error_002dpage_jsp.java:82)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:416)
at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
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:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
10:14:34.962 [http-8080-4] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open ResultSet (open ResultSets: 0, globally: 0)
10:14:34.963 [http-8080-4] DEBUG org.hibernate.loader.Loader - result row: EntityKey[orm.ReqProcessRec#3785]
2011-10-9 10:14:34 org.apache.catalina.core.StandardHostValve custom
严重: Exception Processing ErrorPage[errorCode=404, location=/error-page.jsp]
org.apache.jasper.JasperException: java.lang.NullPointerException
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:416)
at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
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:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at org.apache.jsp.error_002dpage_jsp._jspService(error_002dpage_jsp.java:82)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
... 19 more
10:14:34.967 [http-8080-4] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close ResultSet (open ResultSets: 1, globally: 1)

10个回答

去你的tomcat(WEB容器)下面看看编译过的JSP文件error_002dpage_jsp.java,就是你的error_002dpage.jsp,应该是在tomcat目录下的:\work\Catalina\localhost\工程名\org\apache\error_002dpage_jsp.java第82行,对应你的JSP中的值,是否有NullPointerException的可能,或者看看有没有路径问题,是不是在什么地方配置了/error-page.jsp这个路径,但是路径是错的。这个应该是你页面里面的问题,虽然没什么大的问题,但是缓存中还是存在这些数据的,有可能在后期出现内存溢出,还是处理了好。

是你页面报的错,能否把页面贴一下

[code="java"]
2种可能:

去你的tomcat(WEB容器)下面看看编译过的JSP文件error_002dpage_jsp.java,就是你的error_002dpage.jsp,应该是在tomcat目录下的:\work\Catalina\localhost\工程名\org\apache\error_002dpage_jsp.java第82行,对应你的JSP中的值,是否有NullPointerException的可能,或者看看有没有路径问题,是不是在什么地方配置了/error-page.jsp这个路径,但是路径是错的。这个应该是你页面里面的问题,虽然没什么大的问题,但是缓存中还是存在这些数据的,有可能在后期出现内存溢出,还是处理了好。

2种:
路径错了,不是绝对路径。
[/code]

[code="java"]
<%=response.setStatus(HttpServletResponse.SC_OK);

  %>  

这个句话 <%=%>这个你知道的,你怎么 <% %>我汗了。
[/code]

response.setStatus(HttpServletResponse.SC_OK);

取消试试看

把错误站出来

[code="java"]
<!-- 从request中获得username,表达式输出 ,request是jsp的内置对象-->
<%String userName=request.getParameter("username");
%>

 <%=userName %>

看看我之前的代码,你的业务思路我不知道,你说说思路,做什么。。。。要不没办法弄

[/code]

[code="java"]

你把改回原来,看看是不是要找:error-page.jsp? 我扛到上面的错误
: Exception Processing ErrorPage[errorCode=404, location=/error-page.jsp] 空指针 找不到这个jsp,你把改回原来的,然后去tomcat里面的webapps 包里面把加载后的项目 删了,然后从新发布,这样应该就行了。
可能是tomcat的原因。
[/code]

null指针异常,分段try catch 找找看

看看你页面的第22行:
An exception was thrown: <%=exception.getClass()%>:<%=exception.getMessage()%>
看看这里的exception是不是空的,有可能是这句话引起的。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!