tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wagoner, Mark" <MWago...@wildflavors.com>
Subject RE: Getting multiple instances of my servlet, although it doesn't implement SingleThreadModel
Date Fri, 01 Mar 2002 14:20:22 GMT
I afraid I have had the good fortune to not have this problem.  :-)

Short of what you have already done, I'm not sure where else to look.  My
understanding is Tomcat invokes init when it loads the servlet.  Is it
possible that the servlet is dieing for some reason and is actually being
re-loaded?

Just a wild guess.

-----Original Message-----
From: Scott Shorter [mailto:shorter@caradas.com]
Sent: Friday, March 01, 2002 9:09 AM
To: 'Tomcat Users List'
Subject: RE: Getting multiple instances of my servlet, although it
doesn't implement SingleThreadModel


Mark,

This sounds kinda similar to what my servlet is for - the overall
application is a testing tool that sometimes acts as a client, sending
messages out, and sometimes as a server.  The servlet that's giving me
problems does two main things - it kicks off the tests in its init()
method (which it why it's important that it be called only once) and it
also receives incoming messages and dispatches them to the correct test
object.

The interesting/odd thing is that this problem occurs on only two of the
three machines on which the system runs.  I've pored over the
configurations of the three machines, and can't figure out what
difference could be causing this.  Can you suggest where I can look,
beyond the web.xml and server.xml files?

Thanks,
Scott

> -----Original Message-----
> From: Wagoner, Mark [mailto:MWagoner@wildflavors.com] 
> Sent: Friday, March 01, 2002 9:06 AM
> To: 'Tomcat Users List'
> Subject: RE: Getting multiple instances of my servlet, 
> although it doesn't implement SingleThreadModel
> 
> 
> I don't think this is exactly true.  I have an app using the 
> mediator design pattern, in which there is only one servlet 
> handling all requests (all of my servlet mappings point to 
> the same servlet).  It in turn hands the requests off to 
> various classes and/or JSP pages for actual processing.  
> Within this servlet's init method is where I create my 
> connection pool, configure Log4j logging, etc.  I have never 
> seen any case of init being called more than once.
> 
> -----Original Message-----
> From: Randy Layman [mailto:randy.layman@aswethink.com]
> Sent: Friday, March 01, 2002 6:38 AM
> To: 'Tomcat Users List'
> Subject: RE: Getting multiple instances of my servlet, 
> although it doesn't implement SingleThreadModel
> 
> 
> 
> 	Basically, Tomcat will create a separate instance for 
> each unique URL that the servlet responses to.
> 
> 	(Technically, every time you define the servlet in the 
> web.xml there is a separate instance, and another instance is 
> created when you use the ServletInvoker to invoke the servlet 
> by /servlet/className.)
> 
> 	Randy
> 
> 
> > -----Original Message-----
> > From: Scott Shorter [mailto:shorter@caradas.com]
> > Sent: Thursday, February 28, 2002 4:34 PM
> > To: 'Tomcat Users List'
> > Subject: Getting multiple instances of my servlet, although 
> it doesn't 
> > implement SingleThreadModel
> > 
> > 
> > All,
> > 
> > I have a servlet that loads on startup, per the 
> <load-on-startup/> tag 
> > in web.xml.  It does *not* implement SingleThreadModel.
> > 
> > Unfortunately, two instances start up every time Tomcat 
> starts - I can 
> > tell because I have a System.out.println call in init().  I 
> need for 
> > there to be only one instance.
> > 
> > What other settings could be causing multiple instances to happen?
> > 
> > Thanks in advance,
> > Scott
> > 
> > 
> > --
> > 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>
> 


--
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