You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by andreas ebbert <eb...@imm.rwth-aachen.de> on 2000/12/08 10:43:35 UTC

Re: getServletContext() returns nullpointer-exception

On Thu, 07 Dec 2000 19:15:47 -0600, William Brogden wrote:

>
>
>andreas ebbert wrote:
>> 
>> Hi,
>> I am trying to get a servlets context
>> with getServletContext() but all I get
>> is a NullPointerException. Can anybody
>> help me?
>> 
>> greetings,
>> Andreas
>
>The usual reason for this is a failure to call super.init()
>in your servlet init method. Assuming your init is:
>
>  public void init( ServletConfig config ){
>     super.init( config ) ; // Essential!!
>    ....
>  }
>-- 
>WBB - wbrogden@lanw.com
>Java Cert mock exams http://www.lanw.com/java/javacert/
>Author of Java Developer's Guide to Servlets and JSP 
>ISBN 0-7821-2809-2
>
I´ve not implemented the servlet init()-methods.
any other ideas?
(I am using win98, apache 1.3.14, tomcat 3.2)

-----------------------------------------------------------------------
Andreas Ebbert, Kuthstrasse 43, 51107 Koeln
e-mail: ebbert@imm.rwth-aachen.de
Fon: 0221-8701503,        Fax: 0221-5345842
-----------------------------------------------------------------------