TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG-DEVEL:147] nullpointer



Erick Stohr wrote:
> 
> I am trying to run a servlet using jswd-1.0.1 and I get this error:
> 
>    Error: 500
> 
> Internal Servlet Error:
> 
> java.lang.NullPointerException
>         at Setup.doGet(Setup.java, Compiled Code)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:715)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
>         at
> com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:155)
>         at
> com.sun.web.core.InvokerServlet.service(InvokerServlet.java:168)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
>         at
> com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:155)
>         at com.sun.web.core.Context.handleRequest(Context.java:414)
>         at
> com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:139)
> 
> I have been scanning the java.sun.forum, but have had no luck.I don't
> think it is my code, but of course it could be.Is it some type of config
> thing? Anybody have any ideas? All the servlet does it take in
> parameters from a HTML form, that is all right now until I get the thing
> to work. There is an init() method, a dopost() that calls doGet() and a
> destroy. The doGet takes in the parameters. Thanks.
> 

It's there, you just have to look:

1) Do you have the ability to run the servlet engine through a
debugger?  By this I mean, I can startup Tomcat within VisualAge for
Java, set a break point in my servlet and once I invoke the servlet, a
debugger window will come up.

2) If you code Java in vi (shudder) and have no debugger, then
System.out.println is your friend.  Code System.out.println and dump out
your variables and steps in the code.

3) You might want to start building a Trace utility so that you can turn
on and off your trace statements selectively and don't have continuously
comment/uncomment code.

-- 
Perry Hoekstra
Talent Software Services
dutchman@mn.uswest.net

A person who smiles in the face of adversity... probably has a scapegoat