*
The moose likes Tomcat and the fly likes Servlet requests are created automatically in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Servlet requests are created automatically in tomcat" Watch "Servlet requests are created automatically in tomcat" New topic
Author

Servlet requests are created automatically in tomcat

deepa raj
Ranch Hand

Joined: Jul 25, 2008
Posts: 124
Dear Ranchers,

We have deployed one simple servlet in Tomcat which will extract the records from DB.When we give the request to that servlet , it executes well if the records are less.If the records are more (means it will execute some long time) , after some time , automatically , one new request has been generated by the Tomcat.Both the request are processing in the server.After some time, the third request has been generated.and so on...

If anybody facing these kind of issues ? Please help us to resolve this issue.

Regards,
Deepa Raja
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

3 requests generated by Tomcat? Are you sure the user is not just hitting refresh?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
deepa raj
Ranch Hand

Joined: Jul 25, 2008
Posts: 124
Yes. We are sure. Only one time we have given the request.
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Are you using a special browser that re-fires requests if they seem to be dead ?
Are there such browsers anyway ?


JDBCSupport - An easy to use, light-weight JDBC framework -
Shashank Rudra
Ranch Hand

Joined: Mar 26, 2009
Posts: 131
Has it to do something with request time-out. And then some kind of automatic handling by Tomcat there on. As here we are talking about cases where processing is taking longer while.


Programmer Analyst || J2EE web development/design
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Tomcat should never create a request for any reason, and I've never heard of it doing this. My guess would be that its coming from the browser. Have you tried sticking using soemthing like wireshark to watch the traffic?
deepa raj
Ranch Hand

Joined: Jul 25, 2008
Posts: 124
We are using IE and firefox.

We didnt check the network traffic. Is there any header related problems?
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

Can't say what the problem is, at least not from what you describe.

Could you tell us how you come to know that "after some time automatically , one new request has been generated by the Tomcat"? Debugging statements? Message on console. What gives you a reason to think this happens?

Can you give some back ground on where the application is deployed? Internet? Intranet? On your own computer?

"If the records are more (means it will execute some long time) ,.." What does long time mean here? 5 mins? 10 mins? 15 mins?

Well maybe some of the details would give away what exactly is happening at your end ...


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
deepa raj
Ranch Hand

Joined: Jul 25, 2008
Posts: 124
Yes.the Servlet is deployed in Tomat 6 /Linux in my own computer.Servlet will connect to the Database and retrieve the records.

We have system.out statements. One thread is processing the request , again the new thread is trying to execute from the starting.(Catalina.out is having log statements.)

Records will be retrieved based on dates.1 day or 10 day like that. For example if we give to retrieve the records for 1 day ,then the servlet is working properly.But , if we give 10 days to retrieve , the request is processing after some 5 mins , again new thread is started.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I don't see how that's possible without Tomcat being told to start a new request. I have *never* seen behavior like that without something in my code causing it to happen.

Can you provide more information?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9329
    
110

deepa raj wrote:
But , if we give 10 days to retrieve , the request is processing after some 5 mins , again new thread is started.


Are you sure only Tomcat is involved? Or is it fronted with maybe Apache HTTPD/mod_jk. From what i know, mod_jk has retries on request timeouts. So if a request times out, it is tried again (for some pre-configured retry attempts).

[My Blog] [JavaRanch Journal]
deepa raj
Ranch Hand

Joined: Jul 25, 2008
Posts: 124
Could you please tell me more about Apache HTTPD/mod_jk ?

And also , how to check the request timeout ? Any config file?

Yes.It is using Apache 2 / Tomcat 6.0 installed in SUSE Linux .But i havent see any mod_jk related files.But i am able to see prefork related files are there.I am very new to these files.Please help me to get it resolved.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9329
    
110

deepa raj wrote:

Yes.It is using Apache 2 / Tomcat 6.0 installed in SUSE Linux .But i havent see any mod_jk related files.But i am able to see prefork related files are there.I am very new to these files.Please help me to get it resolved.


I am not an expert on this. The Apache HTTPD documentation http://httpd.apache.org/docs-project/ would be a better place to look. I think the file where these things are configured is workers.properties. But as i said, i don't have much experience with that.
Satish Bellapu
Greenhorn

Joined: Dec 07, 2012
Posts: 1
Hey deepa raj,
I am going through this thread today... i am facing similar kind of an issue in my setup... can you please let me know have you found the solution for this ... this might be way old request... but this will help us in debugging in and fixing the root-cause.

Thanks in advance,
Regards,
Satish Bellapu.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet requests are created automatically in tomcat
 
Similar Threads
Tomcat creates new threads without new request
Is Tomcat stable?
making jsp wait
Servlet requests are created automatically in tomcat :-)
Data Object/LockManager