You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alexander Cherinko <ch...@protec.kiev.ua> on 2001/08/08 16:38:08 UTC

Double loading when loading servlet on startup

Hi
problem is that when I mark servlets as load-on-startup they are loaded
twice in jvm.
I want this servlet to serve as initializer i.e. to initialize some other
classes in its init method.
The worst is that that classes are double loaded too. I.e. I want to init
class which is Thread subclass to perform periodical custom action. As
result I have double threads running in jvm and making the same things! That
was obviousely not my real intention.
>From the other hand when I launch that initializer from common servlet (not
loaded on startup) the problem is not present.
The most strange thing about it is that in both cases all classes are loaded
with the same ClassLoader.
I cannot understand is it a bug or just I don't understand something.
Please help.
--Che


RE: Double loading when loading servlet on startup

Posted by Alexander Cherinko <ch...@protec.kiev.ua>.
3.2.1 on NT/Linux.
I had the same problem on earlier versions.
And Loic Lefevre [llefevre@fivia.com] has got the same on NT with v.3.2.3.
--Che

> -----Original Message-----
> From: Mike McGuinness [mailto:mmcguinn@lssi.net]
> Sent: Wednesday, August 08, 2001 7:14 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Double loading when loading servlet on startup
> 
> 
> What version of tomcat?
> 
> Alexander Cherinko wrote:
> 
> > Hi
> > problem is that when I mark servlets as load-on-startup they are loaded
> > twice in jvm.
> > I want this servlet to serve as initializer i.e. to initialize 
> some other
> > classes in its init method.
> > The worst is that that classes are double loaded too. I.e. I 
> want to init
> > class which is Thread subclass to perform periodical custom action. As
> > result I have double threads running in jvm and making the same 
> things! That
> > was obviousely not my real intention.
> > >From the other hand when I launch that initializer from common 
> servlet (not
> > loaded on startup) the problem is not present.
> > The most strange thing about it is that in both cases all 
> classes are loaded
> > with the same ClassLoader.
> > I cannot understand is it a bug or just I don't understand something.
> > Please help.
> > --Che
> 
> 
> 

Re: Double loading when loading servlet on startup

Posted by Mike McGuinness <mm...@lssi.net>.
What version of tomcat?

Alexander Cherinko wrote:

> Hi
> problem is that when I mark servlets as load-on-startup they are loaded
> twice in jvm.
> I want this servlet to serve as initializer i.e. to initialize some other
> classes in its init method.
> The worst is that that classes are double loaded too. I.e. I want to init
> class which is Thread subclass to perform periodical custom action. As
> result I have double threads running in jvm and making the same things! That
> was obviousely not my real intention.
> >From the other hand when I launch that initializer from common servlet (not
> loaded on startup) the problem is not present.
> The most strange thing about it is that in both cases all classes are loaded
> with the same ClassLoader.
> I cannot understand is it a bug or just I don't understand something.
> Please help.
> --Che



RE: Double loading when loading servlet on startup

Posted by Loпc Lefиvre <ll...@fivia.com>.
Got the same problem :(((((( (on v3.2.3 - NT)

-----Message d'origine-----
De : Alexander Cherinko [mailto:cher@protec.kiev.ua]
Envoye : mercredi 8 aout 2001 16:38
A : tomcat-user@jakarta.apache.org
Objet : Double loading when loading servlet on startup


Hi
problem is that when I mark servlets as load-on-startup they are loaded
twice in jvm.
I want this servlet to serve as initializer i.e. to initialize some other
classes in its init method.
The worst is that that classes are double loaded too. I.e. I want to init
class which is Thread subclass to perform periodical custom action. As
result I have double threads running in jvm and making the same things! That
was obviousely not my real intention.
>From the other hand when I launch that initializer from common servlet (not
loaded on startup) the problem is not present.
The most strange thing about it is that in both cases all classes are loaded
with the same ClassLoader.
I cannot understand is it a bug or just I don't understand something.
Please help.
--Che