Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 8699 invoked from network); 1 Mar 2002 14:18:30 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 1 Mar 2002 14:18:30 -0000 Received: (qmail 10022 invoked by uid 97); 1 Mar 2002 14:17:54 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 9979 invoked by uid 97); 1 Mar 2002 14:17:53 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 9912 invoked from network); 1 Mar 2002 14:17:53 -0000 Message-ID: From: Randy Layman To: 'Tomcat Users List' Subject: RE: Getting multiple instances of my servlet, although it doesn't implement SingleThreadModel Date: Fri, 1 Mar 2002 08:31:50 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I guess what I said has led to some confusion. I meant that each tag creates an instance. Here are the possible reasons for getting multiple instances: 1. Multiple tags in web.xml 2. One or more tag(s) in web.xml and using /servlets/ to access your servlet 3. Having the same context loaded multiple times. This generally happens because the AutoContextLoader (or whatever its called) is still enabled and an explicit Context is also defined, making two contexts (and two instances of the servlets). Randy > -----Original Message----- > From: Scott Shorter [mailto:shorter@caradas.com] > Sent: Friday, March 01, 2002 9:05 AM > To: 'Tomcat Users List' > Subject: RE: Getting multiple instances of my servlet, although it > doesn't implement SingleThreadModel > > > Randy, > > The servlet is defined once in web.xml - one tag, > that is. In > addition it is mapped to the root URL with a statement of the form: > > > MessageDispatcherServlet > / > > > Are you saying the servlet mapping is responsible for the multiple > instances? > > I don't think that's the case, because I can comment out the > mapping and > still get the same results. > > Thanks, though. I'll keep working at it. > - > Scott > > > -----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 > > 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: > > unsubscribe@jakarta.apache.org> > > > For > > additional commands: > > > > > Troubles with the list: > > > > > > > > > -- > > To > > unsubscribe: > > For additional commands: > > > Troubles with the list: > > > > > > -- > To unsubscribe: > For additional commands: > Troubles with the list: > -- To unsubscribe: For additional commands: Troubles with the list: