Did you override init(ServletConfig config) method?
YOu must call super(config) if you did...

--V.

-----Original Message-----
From: Stefanos Karasavvidis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 10, 2001 7:46 AM
To: [EMAIL PROTECTED]
Subject: getServletContext() throws NullPoinetException


I've just installed tomcat 3.2.2 and have the following problem.

I want to call getServletContext() from a servlets service method but 
get the folowing exception
*Internal Servlet Error:*

java.lang.NullPointerException
        at
javax.servlet.GenericServlet.getServletContext(GenericServlet.java:205)
        at TestServlet.service(TestServlet.java:32)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
        at org.apache.tomcat.core.Handler.service(Handler.java:287)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
        at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:166)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
        at java.lang.Thread.run(Thread.java:484)


Moreover the getServletConfig() returns null which is probably the main 
reason for this problem

Any ideas??

Stefanos



***********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original
message.
***********************************************************************

Reply via email to