You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sourabh Antani <so...@yahoo.com> on 2006/06/06 19:40:39 UTC

Tomcat creating two threads for one request

Hi, 
   
  I am facing this situation. I have a login screen, when the user clics the submit button, Tomcat sometimes creates two threads in parallel to process the request. This causes a problem with the database. This does not always happen. Most of the time it creates only one thread as expected. However, every once in a while it will create two threads that run in parallel. 
   
  Any ideas?
   
   
  Thanks,
   
  Sourabh Antani

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: multiple tomcat services

Posted by Len Popp <le...@gmail.com>.
Here's a how-to that was posted to this mailing list:
http://www.nabble.com/Re%3A-running-two-instances-of-tomcat-p3560229.html
I haven't tried it myself, but it looks pretty complicated so it must
be right. :-)
-- 
Len

On 6/21/06, Bharathi Kattamuri <Bh...@manchester.ac.uk> wrote:
> Hi,
>
>
> I have installed multiple tomcat instances with apche server and  mod_jk
> connector, in windows environment.
>
> I have problem in configuring the tomcats as separate services.  Could
> anyone suggest me how to install these tomcats as services.
>
> Any help is appreciated.
>
> with regards,
> Bharathi
> >
> >
>
>
> ---------------------------------------------------------------------
> 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


multiple tomcat services

Posted by Bharathi Kattamuri <Bh...@manchester.ac.uk>.
Hi,


I have installed multiple tomcat instances with apche server and  mod_jk 
connector, in windows environment.

I have problem in configuring the tomcats as separate services.  Could  
anyone suggest me how to install these tomcats as services.

Any help is appreciated.

with regards,
Bharathi
>
>   


---------------------------------------------------------------------
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


Re: Tomcat creating two threads for one request

Posted by Darryl Miles <da...@netbauds.net>.
ametsi wrote:
> The problem seems to occur by a double submission of the Post. That is, I
> found that except of the “submit” button of the form that I use which
> invokes the jsp, I am also using a small java script, which accidentally
> submits the Post for one more time. I changed the java script and now it
> seems that the jsp is invoked once as expected.

Are you sure you dont have any spyware or malware installed on your 
computer using the browser ?

Some malware intercepts your POST method requests and redirect them to a 
3rd party and then executes the original POST request as a form of 
redirection to the original site.  This can show up as a double request 
coming in within a short space of time from the server side.


One of the previous posters indicated they were using an in-house HTTP 
client, is this built on top of any MS components for HTTP ?  Or a 
complete in-house http client implementation.


Maybe MS Anti-Spyware or Spybot Search and Destroy can assist you to 
confirm with ruling out that possible cause.

If you do find there is a problem it would be helpful to post back to 
this list with a solved or not-solved.


HTH

Darryl

---------------------------------------------------------------------
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


Re: Tomcat creating two threads for one request

Posted by ametsi <ar...@vodafone.com>.
The problem seems to occur by a double submission of the Post. That is, I
found that except of the “submit” button of the form that I use which
invokes the jsp, I am also using a small java script, which accidentally
submits the Post for one more time. I changed the java script and now it
seems that the jsp is invoked once as expected.
--
View this message in context: http://www.nabble.com/Tomcat-creating-two-threads-for-one-request-t1743271.html#a5047317
Sent from the Tomcat - User forum at Nabble.com.


---------------------------------------------------------------------
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


Re: Tomcat creating two threads for one request

Posted by ametsi <ar...@vodafone.com>.
If I am not mistaken jakarta-tomcat-5.0.28
--
View this message in context: http://www.nabble.com/Tomcat-creating-two-threads-for-one-request-t1743271.html#a4975580
Sent from the Tomcat - User forum at Nabble.com.


---------------------------------------------------------------------
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


Re: Tomcat creating two threads for one request

Posted by Darryl Miles <da...@netbauds.net>.
ametsi wrote:
> Tomcat Version: 5.0

Can you get a more precise version ?  5.0.0 ? 5.0.99 ?


Darryl

---------------------------------------------------------------------
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


Re: Tomcat creating two threads for one request

Posted by ametsi <ar...@vodafone.com>.
ok lets take one thing at a time... I am not an expert on this....

Running the application locally using IntelliJ and tomcat:
java -version: "1.3.1_01"
Tomcat Version: 5.0

While running on the server:
Sun(TM) ONE Application Server 7
java version "1.4.1_06"

Keep in mind that It does not happen all the times!!!! 

--
View this message in context: http://www.nabble.com/Tomcat-creating-two-threads-for-one-request-t1743271.html#a4973139
Sent from the Tomcat - User forum at Nabble.com.


---------------------------------------------------------------------
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


Re: Tomcat creating two threads for one request

Posted by Darryl Miles <da...@netbauds.net>.
ametsi wrote:
> Having a similar problem, I would like to know if you have found any solution
> on this...

No one quoted their Tomcat and JVM versions to help expose the problem.

How are you all sure its no a client problem ?


I can't see how the suggestion is listening on two ports can be a 
problem, that implies the client is sending the request via two 
different ports which is highly unlikely.

A workaround maybe to serialize the request processing.



Tomcat Version ??   JVM Version ??



Darryl

---------------------------------------------------------------------
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


Re: Tomcat creating two threads for one request

Posted by ametsi <ar...@vodafone.com>.
Having a similar problem, I would like to know if you have found any solution
on this...
--
View this message in context: http://www.nabble.com/Tomcat-creating-two-threads-for-one-request-t1743271.html#a4958276
Sent from the Tomcat - User forum at Nabble.com.


---------------------------------------------------------------------
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


Re: Tomcat creating two threads for one request

Posted by Jon Wingfield <jo...@mkodo.com>.
Fair enough. It was the "I'm facing the exactly same problem..." 
statement that got me confused ;)

Personally, I haven't seen this "one request spawns two processes" 
problem. Probably best to post your tomcat version, OS, config etc so 
others on the list may be able to help.

Jon

Nikita Tovstoles wrote:
> I know double-submission isn't part of my problem, because the client 
> sending these requests is our in-house C app.
> 
> -nikita
> 
> Jon Wingfield wrote:
>> I would turn on the access logs (if you haven't already) and check 
>> that the browser isn't actually sending two requests.
>> This can sometimes happen if the user double-clicks submit buttons.
>> There are plenty of threads in the archives of this list suggesting 
>> ways to mitigate this double-submission problem.
>>
>> HTH,
>>
>> Jon
>>
>> Nikita Tovstoles wrote:
>>> Sourab,
>>>
>>> I'm facing the exactly same problem and yet to find a solution. Is 
>>> your Tomcat instance listening on 2 ports by chance? Also is the 
>>> request.getParameterMap() of one of those parallel requests missing 
>>> any query parameters?
>>>
>>> -nikita
>>>
>>> Sourabh Antani wrote:
>>>> Hi,      I am facing this situation. I have a login screen, when the 
>>>> user clics the submit button, Tomcat sometimes creates two threads 
>>>> in parallel to process the request. This causes a problem with the 
>>>> database. This does not always happen. Most of the time it creates 
>>>> only one thread as expected. However, every once in a while it will 
>>>> create two threads that run in parallel.      Any ideas?
>>>>         Thanks,
>>>>      Sourabh Antani
>>>>
>>>>  __________________________________________________
>>>> Do You Yahoo!?
>>>> Tired of spam?  Yahoo! Mail has the best spam protection around 
>>>> http://mail.yahoo.com   
>>>
>>>



---------------------------------------------------------------------
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


Re: Tomcat creating two threads for one request

Posted by Nikita Tovstoles <ni...@eviltwinstudios.net>.
I know double-submission isn't part of my problem, because the client 
sending these requests is our in-house C app.

-nikita

Jon Wingfield wrote:
> I would turn on the access logs (if you haven't already) and check 
> that the browser isn't actually sending two requests.
> This can sometimes happen if the user double-clicks submit buttons.
> There are plenty of threads in the archives of this list suggesting 
> ways to mitigate this double-submission problem.
>
> HTH,
>
> Jon
>
> Nikita Tovstoles wrote:
>> Sourab,
>>
>> I'm facing the exactly same problem and yet to find a solution. Is 
>> your Tomcat instance listening on 2 ports by chance? Also is the 
>> request.getParameterMap() of one of those parallel requests missing 
>> any query parameters?
>>
>> -nikita
>>
>> Sourabh Antani wrote:
>>> Hi,      I am facing this situation. I have a login screen, when the 
>>> user clics the submit button, Tomcat sometimes creates two threads 
>>> in parallel to process the request. This causes a problem with the 
>>> database. This does not always happen. Most of the time it creates 
>>> only one thread as expected. However, every once in a while it will 
>>> create two threads that run in parallel.      Any ideas?
>>>         Thanks,
>>>      Sourabh Antani
>>>
>>>  __________________________________________________
>>> Do You Yahoo!?
>>> Tired of spam?  Yahoo! Mail has the best spam protection around 
>>> http://mail.yahoo.com   
>>
>>
>> ------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> 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
>


Re: Tomcat creating two threads for one request

Posted by Jon Wingfield <jo...@mkodo.com>.
I would turn on the access logs (if you haven't already) and check that 
the browser isn't actually sending two requests.
This can sometimes happen if the user double-clicks submit buttons.
There are plenty of threads in the archives of this list suggesting ways 
to mitigate this double-submission problem.

HTH,

Jon

Nikita Tovstoles wrote:
> Sourab,
> 
> I'm facing the exactly same problem and yet to find a solution. Is your 
> Tomcat instance listening on 2 ports by chance? Also is the 
> request.getParameterMap() of one of those parallel requests missing any 
> query parameters?
> 
> -nikita
> 
> Sourabh Antani wrote:
>> Hi,      I am facing this situation. I have a login screen, when the 
>> user clics the submit button, Tomcat sometimes creates two threads in 
>> parallel to process the request. This causes a problem with the 
>> database. This does not always happen. Most of the time it creates 
>> only one thread as expected. However, every once in a while it will 
>> create two threads that run in parallel.      Any ideas?
>>         Thanks,
>>      Sourabh Antani
>>
>>  __________________________________________________
>> Do You Yahoo!?
>> Tired of spam?  Yahoo! Mail has the best spam protection around 
>> http://mail.yahoo.com   
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> 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


Re: Tomcat creating two threads for one request

Posted by Nikita Tovstoles <ni...@eviltwinstudios.net>.
Sourab,

I'm facing the exactly same problem and yet to find a solution. Is your 
Tomcat instance listening on 2 ports by chance? Also is the 
request.getParameterMap() of one of those parallel requests missing any 
query parameters?

-nikita

Sourabh Antani wrote:
> Hi, 
>    
>   I am facing this situation. I have a login screen, when the user clics the submit button, Tomcat sometimes creates two threads in parallel to process the request. This causes a problem with the database. This does not always happen. Most of the time it creates only one thread as expected. However, every once in a while it will create two threads that run in parallel. 
>    
>   Any ideas?
>    
>    
>   Thanks,
>    
>   Sourabh Antani
>
>  __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
>