-----Original Message-----
From: Mark van Kerkwyk <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
Date: Friday, May 28, 1999 10:10 AM
Subject: Servlet Error: java.lang.NullPointerException, don't what to do


>Hi ,
>    I have just got jserv running fine under Apache 1.3.6 on Solaris 2.6
>
>I have both Hello and the HelloWorldServlet running fine, so as far as I
>can see, my config is ok.
>
>I have a servlet that I want to test under jserv, it is currently
>running as a servlet in a domino server, it does some jdbc to db2 etc
>and prints out a html page.
>
>When I execute the servlet, I get the following error message in the
>servlet log
>
>[28/05/1999 23:50:54:284] (ERROR) ajp11: Servlet Error:
>java.lang.NullPointerException: null
>[28/05/1999 23:50:54:284] (ERROR) an error returned handling request via
>protocol "ajpv11"
>
>The servlet normally runs fine, as far as I can see, my CLASSPATH is
>setup correctly.
>
>Any ideas on this one ??
>
>Mark :-)


I saw something like this with DB access. I put the code that opened the
connection to the DB in a try/catch construct, and that worked fine if there
was a problem with the DB (the catch clause displayed the exception using
toString() so I could see what the problem was). However, at a later point
the code tried to close the connection whether or not the open had
succeeded, and that caused a NullPointerException in the case that the
connection had failed. Going from memory, I think I fixed it by testing for
null before closing the database connection.

Pete Ford
Lufkin TX




-- --------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to