首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

servlet引起的有关问题

2013-09-11 
servlet引起的问题本人新手,由于不太了解servlet,所以对有些方面不太了解,现在本人做的项目中,出现了以下

servlet引起的问题
本人新手,由于不太了解servlet,所以对有些方面不太了解,现在本人做的项目中,出现了以下问题:
Servlet.service()   for   servlet   jsp   threw   exception
java.lang.NullPointerException
at   org.apache.jsp.ncsq_jsp._jspService(ncsq_jsp.java:69)
at   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at   org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at   org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at   org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
at   org.apache.jsp.index_jsp._jspService(index_jsp.java:240)
at   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at   org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at   org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at   org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at   org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at   org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at   java.lang.Thread.run(Thread.java:595)
我把request.getPamarer写在service里面,但我看见大部分人是写在doXX方法里。出现这样的问题是不是和我写在service方法里有些关系?

[解决办法]
不是,这个是空指针异常,是说你某个对象没有初始化(=null),但是你却要调用他的属性或方法,就会出现这样的问题。
[解决办法]
设端点跟踪调试一下,看看问题到底在哪里啊.
[解决办法]
看看你的servlet

[解决办法]
at org.apache.jsp.ncsq_jsp._jspService(ncsq_jsp.java:69)


贴出来
[解决办法]
ncsq.jsp文件里面用到了一个空对象
我的异常网推荐解决方案:Servlet.service() for servlet default threw exception,http://www.myexception.cn/eclipse/181756.html

热点排行