tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Eastham" <andy.east...@gliant.com>
Subject RE: Servlet init() callin twice on startup. PLease help.
Date Mon, 29 Apr 2002 19:51:50 GMT
Ivan,

I had this problem.  I found it was caused when you use Tomcat Standalone
and Tomcat Apache (at least when using mod_webapp / warp).  I don't need
Tomcat Standalone, so I removed it from server.xml.  It seemed that a
separate class instance was being loaded for each (I tested 4.0.1 and
4.0.4b1).  If you need both access methods, you can at least share the same
instance by putting your classes in Tomcat/common/lib in a jar, rather than
webapps/appname/classes, although the init() method will still get called
twice.  You just have to write the init method so that it already knows it's
been called.

By the way, if you remove Tomcat standalone, to get Tomcat to call the init
method, you have to start Tomcat then restart Apache.

Personally, I'm not sure this behaviour is "As Designed", but this fixed it
for me.  I, like most others it seems, find the whole area involving
connectors somewhat difficult to understand.  I don't see why different
connectors should involve different sets of class instances.

Hope this helps,

Andy

> -----Original Message-----
> From: Donie Kelly [mailto:donie.kelly@tecnomen.ie]
> Sent: 29 April 2002 19:15
> To: 'Tomcat Users List'
> Subject: RE: Servlet init() callin twice on startup. PLease help.
>
>
> Do you have  the servlet mapped twice in web.xml?
>
> -----Original Message-----
> From: IvanLatysh [mailto:ivan@yourmail.com]
> Sent: 29 April 2002 19:17
> To: Tomcat Apache
> Subject: Servlet init() callin twice on startup. PLease help.
>
> I have servlet that executing on start up.
> And when I see log - i can see that servlet was started twice.
> I need to start it one.
> Where I am wrong ?
>
> Sincerely yours, Ivan Latysh.
> Ivan@yourmail.com
> http://ivan.yourmail.com
>
>
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>
>



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message