Hi David, Yes, that's normal. It's because you haven't initialized your servlet. You need to call:
MyServlet servlet = new MyServlet(); servlet.init(config); <---- important line [...] Thanks -Vincent > -----Original Message----- > From: Karr, David [mailto:[EMAIL PROTECTED] > Sent: 26 January 2004 22:06 > To: [EMAIL PROTECTED] > Subject: Cactus141: Trying to test servlet with "log()" calls, no > ServletConfig > > I'm trying to build tests for a servlet that calls "log(...)" in the > servlet code. When it calls this, it's throwing an exception like this: > > java.lang.NullPointerException > at > javax.servlet.GenericServlet.getServletContext(GenericServlet.java:204) > at javax.servlet.GenericServlet.log(GenericServlet.java:321) > > I narrowed this down to realizing that the ServletConfig was null. How > is this normally supposed to be set in this environment? > > I'm using Cactus1.4.1, JDK1.4.2, and Tomcat4.1.29. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
