Rahul --
Yeah, you're right. The problem, though, is that he's seeing two instances start when a servlet's init() method is called. This means the singleton doesn't have the "mechanism to track the daemon state (running, notStarted)" in place.
We agree. My point was just that moving the code that calls into the singleton from the init() method to the doPost() won't fix anything. If the singleton is broken, he'll have the same problem if he hits the URL twice. The problem lies in the singleton object.
justin
At 05:27 PM 3/24/2003, you wrote:
Hi Justin,
Since the daemon is a singleton.... i think... hitting the same URL twice shouldn't be a problem if mechanism to track the daemon state (running, notStarted ) is in place.
The problem as you said might be in the configuration.
Cheers,
Rahul
----- Original Message ----- From: "Justin Ruthenbeck" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, March 25, 2003 12:43 PM Subject: Re: Servlet init() versus doPost() Classloading???
> Hi Micael, > > Seems you're sidestepping the real problem by trying to initialize with a > doPost call ... the init() method is, afterall, meant for such > initialization. ;) Won't you have the same problem is you hit the URL > twice? > > If there are two copies of your deamon thread starting, then the problem is > in the code that starts them and can be changed to get the desired > behavior. Before going into thoughts on that, is there anything non-basic > about your setup that would complicate the problem (such as clustered > Tomcats, multiple JVMs, or other code that can start this daemon)? > > My apologies if you're absolutely sure you want to do this from a > doPost(). (?!) > > justin
____________________________________ Justin Ruthenbeck Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential See http://www.nextengine.com/confidentiality.php ____________________________________
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
