我创建了一个带有一些html页面的简单servlet动态项目....
单击表单上的提交按钮应该将控件转移到servlet,我不知道是什么问题,它显示“HTTP状态500”错误.... 它将错误显示为:
浏览器上出现异常: 显示java.lang.NullPointerException controller.Trafcontrol.doGet(Trafcontrol.java:48) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
使用的App服务器:JBOSS AS 4.2.2,Eclipse:Helios 3.6 ..
我需要将我的控件传递给servlet,因此我可以使用我的项目进一步处理。
我还包括“控制台”窗口内容:
`Servlet.service() for servlet servname threw exception
java.lang.NullPointerException
at controller.Trafcontrol.doGet(Trafcontrol.java:48)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:583) 在org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:446) 在java.lang.Thread.run(未知来源)`
请对此提供任何帮助,thx .....
答案 0 :(得分:0)
错误很明显。在第48行的Trafcontrol.java
中有一个NullPointerException。您必须检查自己的代码,可能使用Eclispe调试功能来逐步执行代码。