Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: RE: Tomcat 3.2 Problems


Message #1 by Kapil <subscribaa@y...> on Fri, 1 Jun 2001 00:18:28 -0700 (PDT)
When you do java server programming, you're using threads anyhow. Just
accept it.
BTW, if you're doing GUI stuff, you're also using different threads. And
then there's always the garbage collector. You cannot escape from threads.

Please post the JSP code so that we can have a better look, but what I
suspect is that you're using
<%! %> tags to declare your variables.
I've written this a 100 times, but it's very difficult to make people use
<%! %> tags correctly.
Rule 1: DON'T USE <%! %> TAGS.
Rule 2: If you really know what you're doing, and you know servlets and so.
Well, then once in a while <%! %> tags might help you.

Especially if you don't like to be confronted with threads stick to Rule 1
;-)

Geert Van Damme


> -----Original Message-----
> From: Kapil [mailto:subscribaa@y...]
> Sent: vrijdag 1 juni 2001 9:18
> To: Pro_JavaServer_Pages
> Subject: [pro_jsp] RE: Tomcat 3.2 Problems
>
>
> Hi,
> I am a bit confused. We are not using threads. Each
> user has his own session where all session information
> is stored. Only time request goes to server is when he
> submits a form. Why do we need to have threads here.
> The sessions are independant of each other right? Also
> for this part we are only using beans and not servlets
> so no question of thread mgmt in sessions.
>
> Also the error comes when two people are running the
> same JSP page and they both click submit at the same
> time. And the errors are different eveytime. Some
> times its a null pointer exception. Sometimes a
> exception from the bean where we are doing database
> access. I cant understand this.
>
> we are using scope=session for each bean referenced in
> the JSP. Does this create any difference?
>
> Kapil
>
> --- Mike Curwen <mikec@q...> wrote:
> > What is the servlet error?  I mean, what is the
> > underlying error?
> >
> > It could have to do with servlet code that is not
> > thread safe.  Perhaps
> > there is some method that destroys an object, which
> > is currently needed by
> > someone else who is running another thread in the
> > servlet.. this would throw
> > a null pointer exception, which would probably
> > bubble up to a servlet
> > exception.
> >
> >
> > -----Original Message-----
> > From: Kapil [mailto:subscribaa@y...]
> > Sent: Thursday, May 31, 2001 4:01 AM
> > To: Pro_JavaServer_Pages
> > Subject: [pro_jsp] Tomcat 3.2 Problems
> >
> >
> > Hi,
> > I am using Tomcat 3.2.1 along with IIS 5.0 and JSPs
> > in
> > my applications. However when too many users (3 or
> > more) run the same application and try to navigate
> > thru the site, the load on tomcat seems to increase
> > and it gives a servlet exception. Once the user
> > refreshes the page it works fine. This specifically
> > happens when two people hit the submit button on a
> > form at the same instant.
> >
> > What could be wrong? Is Tomcat not stable for a huge
> > load? Will switching to WebLogic or JRun solve the
> > problems?
> >
> > Kapil
> >

  Return to Index