Hi
I am working with the Tomcat 5.5 on Eclipse, and is getting the error when my servlet calls the jsp using request dispatcher, the error is:
HTTP status 500
The server encountered an internal error () that prevented it from fulfilling this request.
and the log of the exception is:
Oct 27, 2008 9:41:15 AM org.apache.cata lina.core.Stand ardWrapperValve invoke
SEVERE: Servlet.service () for servlet Controller threw exception
java.lang.NullP ointerException
at Controller.doGe t(Controller.ja va:46)
at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:627)
at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:729)
at org.apache.cata lina.core.Appli cationFilterCha in.internalDoFi lter(Applicatio nFilterChain.ja va:269)
at org.apache.cata lina.core.Appli cationFilterCha in.doFilter(App licationFilterC hain.java:188)
at org.apache.cata lina.core.Stand ardWrapperValve .invoke(Standar dWrapperValve.j ava:213)
at org.apache.cata lina.core.Stand ardContextValve .invoke(Standar dContextValve.j ava:172)
at org.apache.cata lina.core.Stand ardHostValve.in voke(StandardHo stValve.java:12 7)
at org.apache.cata lina.valves.Err orReportValve.i nvoke(ErrorRepo rtValve.java:11 7)
at org.apache.cata lina.core.Stand ardEngineValve. invoke(Standard EngineValve.jav a:108)
at org.apache.cata lina.connector. CoyoteAdapter.s ervice(CoyoteAd apter.java:174)
at org.apache.coyo te.http11.Http1 1Processor.proc ess(Http11Proce ssor.java:875)
at org.apache.coyo te.http11.Http1 1BaseProtocol$H ttp11Connection Handler.process Connection(Http 11BaseProtocol. java:665)
at org.apache.tomc at.util.net.Poo lTcpEndpoint.pr ocessSocket(Poo lTcpEndpoint.ja va:528)
at org.apache.tomc at.util.net.Lea derFollowerWork erThread.runIt( LeaderFollowerW orkerThread.jav a:81)
at org.apache.tomc at.util.threads .ThreadPool$Con trolRunnable.ru n(ThreadPool.ja va:689)
at java.lang.Threa d.run(Unknown Source)
and when I go to the line in the controller.java which is giving me the exception, I do not find anything wrong with it, this is the line:
RequestDispatch er dispatcher = getServletConfi g().getServletC ontext().getReq uestDispatcher( "/view.jsp");
dispatcher.forw ard(request, response);
Any clarifications highly appreciated.
When I debug my code, I find that the config is null just before the RequestDispatch er line. What does that mean ?
thanks.
I am working with the Tomcat 5.5 on Eclipse, and is getting the error when my servlet calls the jsp using request dispatcher, the error is:
HTTP status 500
The server encountered an internal error () that prevented it from fulfilling this request.
and the log of the exception is:
Oct 27, 2008 9:41:15 AM org.apache.cata lina.core.Stand ardWrapperValve invoke
SEVERE: Servlet.service () for servlet Controller threw exception
java.lang.NullP ointerException
at Controller.doGe t(Controller.ja va:46)
at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:627)
at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:729)
at org.apache.cata lina.core.Appli cationFilterCha in.internalDoFi lter(Applicatio nFilterChain.ja va:269)
at org.apache.cata lina.core.Appli cationFilterCha in.doFilter(App licationFilterC hain.java:188)
at org.apache.cata lina.core.Stand ardWrapperValve .invoke(Standar dWrapperValve.j ava:213)
at org.apache.cata lina.core.Stand ardContextValve .invoke(Standar dContextValve.j ava:172)
at org.apache.cata lina.core.Stand ardHostValve.in voke(StandardHo stValve.java:12 7)
at org.apache.cata lina.valves.Err orReportValve.i nvoke(ErrorRepo rtValve.java:11 7)
at org.apache.cata lina.core.Stand ardEngineValve. invoke(Standard EngineValve.jav a:108)
at org.apache.cata lina.connector. CoyoteAdapter.s ervice(CoyoteAd apter.java:174)
at org.apache.coyo te.http11.Http1 1Processor.proc ess(Http11Proce ssor.java:875)
at org.apache.coyo te.http11.Http1 1BaseProtocol$H ttp11Connection Handler.process Connection(Http 11BaseProtocol. java:665)
at org.apache.tomc at.util.net.Poo lTcpEndpoint.pr ocessSocket(Poo lTcpEndpoint.ja va:528)
at org.apache.tomc at.util.net.Lea derFollowerWork erThread.runIt( LeaderFollowerW orkerThread.jav a:81)
at org.apache.tomc at.util.threads .ThreadPool$Con trolRunnable.ru n(ThreadPool.ja va:689)
at java.lang.Threa d.run(Unknown Source)
and when I go to the line in the controller.java which is giving me the exception, I do not find anything wrong with it, this is the line:
RequestDispatch er dispatcher = getServletConfi g().getServletC ontext().getReq uestDispatcher( "/view.jsp");
dispatcher.forw ard(request, response);
Any clarifications highly appreciated.
When I debug my code, I find that the config is null just before the RequestDispatch er line. What does that mean ?
thanks.
Comment