Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 2579 invoked from network); 16 Jun 2006 17:37:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jun 2006 17:37:56 -0000 Received: (qmail 41955 invoked by uid 500); 16 Jun 2006 17:37:41 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 41777 invoked by uid 500); 16 Jun 2006 17:37:40 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 41766 invoked by uid 99); 16 Jun 2006 17:37:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 10:37:40 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mason@kbab.net designates 195.54.107.70 as permitted sender) Received: from [195.54.107.70] (HELO mxfep01.bredband.com) (195.54.107.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 10:37:39 -0700 Received: from A643500 ([213.113.253.98] [213.113.253.98]) by mxfep01.bredband.com with SMTP id <20060616173715.YDCQ25882.mxfep01.bredband.com@A643500> for ; Fri, 16 Jun 2006 19:37:15 +0200 Message-ID: <000501c6916b$82dce280$62fd71d5@A643500> From: =?iso-8859-1?Q?Magnus_Larsg=E5rden?= To: "Tomcat Users List" References: <001b01c68fbb$05583140$62fd71d5@A643500> <497fac690606140744q413df46bg1d10c4ada84641b5@mail.gmail.com> <002701c68ff7$5a9a6600$62fd71d5@A643500> <497fac690606160930v52210617j368f7e524cc33d26@mail.gmail.com> Subject: Re: Multiple instances of servlets Date: Fri, 16 Jun 2006 19:37:16 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Len, The SingleThreadModel Interface is _not_ used in the servlet. Maybe I should write a bugreport? Thanks for your help! BR/Magnus ----- Original Message ----- From: "Len Popp" To: "Tomcat Users List" Sent: Friday, June 16, 2006 6:30 PM Subject: Re: Multiple instances of servlets I don't see anything there that would cause the servlet in mydomain2 to be loaded 4 times. The only thing I can think of is that the servlet might be running in single-thread mode (by implementing the SingleThreadModel interface). -- Len On 6/14/06, Magnus Larsg�rden wrote: > Hi Len! > > This is how my two web.xml files look like: > > /home/web/tomcat/webapps/ROOT/WEB-INF/web.xml > > > > > > com.mydomain1.bookingManager.BookingManager > > com.mydomain1.bookingManager.BookingManager > 1 > > > > com.mydomain1.bookingManager.BookingManager > > /servlet/com.mydomain1.bookingManager.BookingManager > > > > > > --> > com.mydomain1.log.Log > com.mydomain1.log.Log > > > com.mydomain1.log.Log > /servlet/com.mydomain1.log.Log > > > > > --> > com.mydomain1.poll.PollMain > com.mydomain1.poll.PollMain > > > com.mydomain1.poll.PollMain > /servlet/com.mydomain1.poll.PollMain > > > > > --> > > com.mydomain1.discgolf.bookingManager.BookingManager > > com.mydomain1.discgolf.bookingManager.BookingManager > 2 > > > > com.mydomain1.discgolf.bookingManager.BookingManager > > /servlet/com.mydomain1.discgolf.bookingManager.BookingManager > > > > > --> > com.mydomain1.discgolf.poll.PollMain > com.mydomain1.discgolf.poll.PollMain > > > com.mydomain1.discgolf.poll.PollMain > > /servlet/com.mydomain1.discgolf.poll.PollMain > > > > > /home/web/tomcat/webapps/mydomain2/WEB-INF/web.xml > > > > > > com.mydomain2.bookingManager.BookingManager > > com.mydomain2.bookingManager.BookingManager > 1 > > > > > com.mydomain2.bookingManager.BookingManager > > /servlet/com.mydomain2.bookingManager.BookingManager > > > > > As I mentioned earlier it is mydomain2 that get four instances of the > "BookingManager" servlet. > > Comments? > > Thanks > /Magnus > > > > > > > > ----- Original Message ----- > From: "Len Popp" > To: "Tomcat Users List" > Sent: Wednesday, June 14, 2006 4:44 PM > Subject: Re: Multiple instances of servlets > > > How many web.xml files do you have, and how many > declarations are there in those files? Each one of those is a > different servlet (even if some of them happen to be implemented by > similar Java classes). Normally, Tomcat will create one instance of > each of those servlets (or one per JVM in a distributed application). > Things are different if you use the single-thread model, but that's > not recommended. > > See the servlet spec for the official details. > -- > Len > > On 6/14/06, Magnus Larsg�rden wrote: > > Hi all, > > > > Is Tomcat supposed to create multiple instances of my servlet at > > startup? > > Or > > is it a bug? > > > > Background: > > ======== > > I have two different domains connected to my Tomcat server (version > > 5.5.17): > > http://mydomain1.host.com and > > http://mydomain2.host.com > > > > "mydomain1" is directed to /home/web/tomcat/webapps/ROOT/ > > and "mydomain2" is directed to /home/web/tomcat/webapps/mydomain2/ > > > > Both domains use a copy of the same servlet except that they belong to > > different packages. Ex: > > The .java files under mydomain1 belong to package > > "com.mydomain1.bookingManager" and are located under > > /home/web/tomcat/webapps/ROOT/WEB-INF/classes/com/mydomain1/bookingManager/ > > > > The .java files under mydomain2 belong to package > > "com.mydomain2.bookingManager" and are located under > > /home/web/tomcat/webapps/mydomain2/WEB-INF/classes/com/mydomain2/bookingManager/ > > > > Problem: > > ====== > > When Tomcat starts it creates only ONE instance of the > > "mydomain1" -servlet, > > and FOUR instances of the "mydomain2" servlet. > > I would really like to only have ONE instance of each servlet. How can I > > achieve this? > > > > I have searched Google for answers but only found contradicting > > statements. > > Some say that Tomcat creates one, and only one instance of each servlet. > > Other say the opposite. > > > > > > All help is appreciated! > > > > Thanks in advance > > BR/Magnus > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To start a new topic, e-mail: users@tomcat.apache.org > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > > For additional commands, e-mail: users-help@tomcat.apache.org > > > > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org