Servlet.service() for servlet jsp threw exception java.lang.NullPointerException
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Servlet.service() for servlet jsp threw exception java.lang.NullPointerException相关的知识,希望对你有一定的参考价值。
空指针异常,用eclipse或myeclipse 的debug 调试一下,看哪个参数或变量的值为空就知道了 参考技术A 去tonmcat的work目录下找网站域名目录下的index.java文件 看看第23行是哪里产生了空指针。追问Listemployees =Listemployees=(List)request.getAttribute("employees");这是什么意思?
参考技术B Servlet类的service方法有空指针异常 参考技术C 空指针异常,打代码发过来让大家看看才能找出问题所在追问Listemployees =Listemployees=(List)request.getAttribute("employees");这是什么意思?谢谢
追答你是不是写错了呀,应该是Listemployees=(List)request.getAttribute("employees");吧,怎么会有这样Listemployees =Listemployees=(List)request.getAttribute("employees");的写法
Servlet.service() for servlet jsp threw exception
严重: Servlet.service() for servlet jsp threw exception
java.lang.ClassCastException: org.apache.catalina.util.DefaultAnnotationProcessor
at org.apache.jasper.servlet.JspServletWrapper.destroy(JspServletWrapper.java:436)
at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:139)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:320)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
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.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
2009-5-23 17:06:21 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
类型转换错误,代码里面应该有地方把一个对象进行类型转换出错了,这种情况可能是你页面获取对象本来是Object类型,被你强转成一个你的实现类型,然而获取到的类型与你要强转的类型并不对应所产生
问这么多次干嘛。。。。 参考技术A 回答什么呢,需要场景描述的。
好运
以上是关于Servlet.service() for servlet jsp threw exception java.lang.NullPointerException的主要内容,如果未能解决你的问题,请参考以下文章
Servlet.service() for servlet [jsp] in context ....错误
Servlet.service() for servlet jsp threw exception
Servlet.service() for servlet [...] in context with path [/...] throw exception [Servlet execution t
Servlet service for Servlet jsp threw exception javax serv
Servlet.service() for servlet UserServlet threw exception java.lang.NullPointerException 空指针异常
严重: Servlet.service() for servlet [jsp] threw exception java.lang.NullPointerException