------------- Begin Forwarded Message -------------

Date: Wed, 17 Mar 1999 16:09:56 -0500 (EST)
From: Kevin Rabito - Stamford CT Area SSE <Kevin.Rabito@East>
Subject: ? JSDK2.0 (Servlet) log() bug? or my goof?
To: [EMAIL PROTECTED]
Cc: Kevin.Rabito@East, joseph.bianco@East
MIME-Version: 1.0
Content-MD5: pD1SYS19x8+bThppLLEaTA==

TIA,

Getting the following exception.

[Wed Mar 17 14:41:19 EST 1999] java.lang.NullPointerException
java.lang.NullPointerException
        at javax.servlet.GenericServlet.getServletContext(Compiled Code)
        at javax.servlet.GenericServlet.log(Compiled Code)
        at WisServlet.WisServerMsg.msgLog(Compiled Code)
        at WisServlet.WisFileInfo.serviceTime(Compiled Code)
        at WisServlet.WisFileInfo.getUriInfo(Compiled Code)
        at WisServlet.service(Compiled Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at com.sun.server.ServletState.callService(Compiled Code)
        at com.sun.server.ServletManager.callServletService(Compiled Code)
        at com.sun.server.webserver.HttpServiceHandler.handleRequest(Compiled
Code)
        at com.sun.server.webserver.HttpServiceHandler.handleRequest(Compiled
Code)
        at com.sun.server.HandlerThread.run(Compiled Code)
=============
WisServerMsg.msgLog code:

package WisServlet;
import javax.servlet.*;^M
import javax.servlet.http.*;^M

public class WisServerMsg extends HttpServlet{

  public WisServerMsg() {
  }

  // Log errors on the WebServer.

  public void eventLog(Exception e, String msg){
    getServletContext().log(e,msg);
  }

  public void msgLog(String msg){
    getServletContext().log(msg);
  }
}

================
Usage:

 WisServlet.WisServerMsg logMsg = new WisServlet.WisServerMsg();

 logMsg.eventLog(e,"File Read Error");  <----- This works.
 logMsg.msgLog(debugMsg);           <--------- This doesn't -
java.lang.NullPointerException

 The exception, String message method of log() is working fine,
 the string message of log() is throwing the exception.

 Any help would be appreciated.
 FYI... Using Java WebSever 1.1.3.

 Thanks,
 Kevin


++++++++++++++++++++++++++++++++++++++++++++++++++++
Kevin Rabito           Area Systems Support Engineer
203 462-9522           NorthEast Area
                       [EMAIL PROTECTED]
Sun Microsystems
2 Stamford Plaza, 10th Floor
281 Tresser Boulevard
Stamford, CT 06901
++++++++++++++++++++++++++++++++++++++++++++++++++++


------------- End Forwarded Message -------------


++++++++++++++++++++++++++++++++++++++++++++++++++++
Kevin Rabito           Area Systems Support Engineer
203 462-9522           NorthEast Area
                       [EMAIL PROTECTED]
Sun Microsystems
2 Stamford Plaza, 10th Floor
281 Tresser Boulevard
Stamford, CT 06901
++++++++++++++++++++++++++++++++++++++++++++++++++++

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to