tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Weidemann <Andre.Weidem...@web.de>
Subject Re: tomcat output gets mixed up for different requests
Date Tue, 03 Aug 2004 09:00:35 GMT
QM wrote:
> Two clients' content getting mixed up with one another: sounds like
> misuse of a shared variable, such as an instance variable inside the
> servlet class, use of the servlet context for client data, etc.

I checked all variables and declarations and I'm sure that there are no
variables being "misused".

For debugging purposes I added a System.out(this); at the beginning of
the doGet() method of the servlet class.

No matter which client is calling the servlet, the output of
System.out(this); is always the same. The output looks like this:

"Navigation@1142196"

So it seems that Tomcat does not spawn a new servlet for a new request,
althought my web.xml file contains:

<servlet>
         <servlet-name>Navigation</servlet-name>
         <servlet-class>Navigation</servlet-class>
         <load-on-startup>5</load-on-startup>
</servlet>


With every client calling the same Method it seems very likely that the
output is getting mixed up.

Adding a *synchronized* in front of the doGet() method, makes the
problem disappear, but also makes the Tomcat very slow.

Any help will be greatly appreciated,
  André.






---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message