My only guess is that perhaps the servlet is loaded from
2 separate contexts.
I remember having this problem earlier.
I was using the <host> directive in server.xml
to point this web app to an apache virtual host.
At the same time, the auto-conf of server.xml would
also load this web application under a different context
with a seprate class loader, hence your static vars 
dont seem to work.

Just my guess.
Regards
Shahed
----- Original Message ----- 
From: "Zsolt Koppany" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 14, 2001 9:28 AM
Subject: Bug or feature


> Hi,
> 
> I want a servlet executed when tomcat is started, thus I made the
> following entries in web.xml
> 
>     <servlet>
>         <servlet-name>startup</servlet-name>
>         <servlet-class>cv.servlet.Startup</servlet-class>
>         <load-on-startup>
>             1
>         </load-on-startup>
>     </servlet>
> 
> The strange thing is that the init method is always executed twice. I
> have already tried to fix it using static boolean variables to check
> whether this is the second execution, but the static variables seem to
> be always null. I know it sounds strange but this is true. The problem
> is that I have to create a ServerSocket and of course the second time I
> get a BindException. Now how can I figure out whether this is "my"
> socket or not.
> 
> I use tomcat-3.2.2 under RedHat-7.1.
> 
> Zsolt
> 
> -- 
> Zsolt Koppany
> Intland GmbH www.intland.com
> Schulze-Delitzsch-Strasse 16
> D-70565 Stuttgart
> Tel: +49-711-7221873 Fax: +49-711-7871017
> 

Reply via email to