Do really need to use SingleThreadedModel for your servlets?  In general its
best avoid this if at all possible.

Section 3.2 of the specification only requires that a servlet container must
guarantee that only one thread is executing through a specific servlet
instance an any time.  Containers *can* create multiple instances to handle
multiple simultaneous requests, but they aren't *required* to do this.  Thus
this can cause portabilty problems across various containers.  I'll take a
look at the SingleThreadedModel code in Tomcat 3.2.2 and see fi anything
jumps out at me.  Your example code will help a lot.  Thanks.


> -----Original Message-----
> From: Bari, Naeem [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 25, 2001 4:51 PM
> To: 'Marc Saegesser'; [EMAIL PROTECTED]
> Subject: RE: Plz help! Tomcat blocks when calling itself - i am
> desperate!
>
>
>
> Marc,
>
> Thanks for your response.
>
> I will put together a little servlet that demonstrates this.
> I did find out the *cause* of the problem. I think this is a
> bug in tomcat...
>
> The situation is this:
>  If you have a servlet that implements the SingleThreadedModel
>  AND
>  this servlet opens a URL back to a servlet in the same container
>  THEN
>  tomcat will block/deadlock
>
> This did not happen with JServ or any other servlet container.
>
> I commented out the "impements sigleThreadedModel" line and
> it worked like a charm.
>
> Hope this helps in determining the problem. I will send the
> servlet to you by tomorrow.
>
> Thanks,
> naeem
>
> > -----Original Message-----
> > From: Marc Saegesser [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, June 25, 2001 4:24 PM
> > To: [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]
> > Subject: RE: Plz help! Tomcat blocks when calling itself - i am
> > desperate!
> >
> >
> > Any chance you could send a small sample application that
> > demonstrates the
> > problem?
> >
> > > -----Original Message-----
> > > From: Bari, Naeem [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, June 25, 2001 2:23 PM
> > > To: '[EMAIL PROTECTED]'
> > > Subject: Plz help! Tomcat blocks when calling itself - i am
> > desperate!
> > >
> > >
> > >
> > > I apologize for posting in the dev group, but postings to the
> > > user group have not shed any light on my problem, and I getting
> > > desperate!
> > >
> > > Here is my problem:
> > > --------------------------------------------------
> > >
> > > My environment:
> > >   Solaris 8 (fully patched)
> > >   jdk 1.3.1, with hotspot enabled
> > >   tomcat 3.2.2
> > >   apache 1.3.19
> > >
> > > The problem:
> > >   I have a servlet that opens a URL connection to the
> > >   servlet container. So if I call http://blah/blinky,
> > >   where blinky is my servlet, it is possible under some
> > >   situations for this servlet to open a URL such as
> > >   http://blah/lumpy, where lumpy is some other servlet.
> > >
> > >   This is part of a largish site publishing framework
> > >   I built on top of JServ. Now, things worked great with
> > >   JServ, but I am having a devil of a time getting this
> > >   to work in Tomcat.
> > >
> > > Observations:
> > >   When the blinky servlet opens a URL to the same tomcat
> > >   instance, the log entries for mod_jk go as far as making
> > >   the call to marshal stuff before calling tomcat - as seen
> > >   by the mod_jk.log entry:
> > >     [jk_ajp13.c (480)]: ajp13_marshal_into_msgb - Done
> > >   At this point, nothing happens. I *should* be seeing entries
> > >   for the jk_open_socket function, but they never appear.
> > >
> > > What I have tried:
> > >   - I have disabled the default 8080 listener, thinking it
> > >     may be interfering.
> > >     No luck
> > >   - I changed the cachesize of the ajp12 and ajp13 workers
> > >     to 8 from the default of 1.
> > >     No luck
> > >   - I added the "min_spare_threads" parameter to the entries
> > >     for the ajp12 and ajp13 connectors in server.xml
> > >     No luck
> > >   - switched between tomcat 3.2.1 and 3.2.2 *and* 4.0b5
> > >     No luck
> > >   - upgraded apache to 1.3.19
> > >     No luck
> > >   - switched between jdk1.2.2 and jdk1.3.1
> > >     No Luck
> > >   - switched between solaris and win2k
> > >     No luck
> > >   - Torn my hair out from the roots
> > >     No luck
> > >
> > > I am at my wits end. Any help will be gratefully accepted.
> > >
> > > TIA,
> > > naeem
> >

Reply via email to