当前位置: 代码迷 >> Java Web开发 >> 新人提问,关于空指针有关问题
  详细解决方案

新人提问,关于空指针有关问题

热度:66   发布时间:2016-04-17 15:46:05.0
新人提问,关于空指针问题
jsp也面报错如下:
exception  

org.apache.jasper.JasperException
at   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
at   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at   org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at   org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at   org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at   org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at   org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at   java.lang.Thread.run(Thread.java:534)


root   cause  

java.lang.NullPointerException
at   java.lang.String.(String.java:141)
at   org.apache.jsp.buy_jsp._jspService(buy_jsp.java:48)
at   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
at   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  相关解决方案