Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes ReadTimeOut Problem in Tomcat4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "ReadTimeOut Problem in Tomcat4" Watch "ReadTimeOut Problem in Tomcat4" New topic
Author

ReadTimeOut Problem in Tomcat4

Varsha Pardeshi
Ranch Hand

Joined: Feb 27, 2006
Posts: 30
Hello Everyone,
I m getting the following error with Tomcat 4.1.31 server.

ERROR
The requested URL could not be retrieved
--------------------------------------------------------------------------
While trying to retrieve the URL: [no URL]
The following error was encountered:
Read Timeout
The system returned:
[No Error]
A Timeout occurred while waiting to read data from the network. The network or server may be down or congested. Please retry your request.

Your cache administrator is webmaster.
---------------------------------------------------------------------------
Generated Thu, 16 Mar 2006 15:38:45 GMT by srishti1 (Squid/2.4.STABLE7)

I m new to java technology & not not able sort out this error. please help me.
1.why this error comes?
2.is it due to more no. of session variables are used in the application? This is my curiosity. please give me the solution.

Thanks in advance.

Regards,
Varsha
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Are you getting this error for all the pages or for a particular page?

It can possible that you are firing a query but it is taking so much time to execute and timeout happens.
[ March 16, 2006: Message edited by: Chetan Parekh ]

My blood is tested +ve for Java.
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Varshajee, check this.
Varsha Pardeshi
Ranch Hand

Joined: Feb 27, 2006
Posts: 30
Originally posted by Chetan Parekh:
Are you getting this error for all the pages or for a particular page?


Not for all pages for 2 pages only
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Originally posted by Varsha Pardeshi:


Not for all pages for 2 pages only


Are you dealing with database in those two pages?
It can possible that you are firing a query but it is taking so much time to execute and timeout happens.
Varsha Pardeshi
Ranch Hand

Joined: Feb 27, 2006
Posts: 30
Originally posted by Chetan Parekh:


Are you dealing with database in those two pages?
It can possible that you are firing a query but it is taking so much time to execute and timeout happens.


No not exactly like that. Actually that jsp page goes to second jsp which is calling Beans methods for some sort of functionality to be achieve.
This bean class is using the other Java class for connecting to the database.

what could be done now?

What I have done is:
I had created one package for an application. In this package one Java class "DatabaseConnection" is estabilishes the database connections. Other JavaBeans are calling the method Dbconnection() from "DatabaseConnection" class to get connected to the database.

how should I manage this? is it the wrong way?
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Varsha, this is the flow of your program

First JSP calls Second JSP calls Bean calls JavaClass.

Right?

Do one thing, add System.out.println() in all entities for the debugging purpose and run the program.

Now you will know from the log that control is passing from where to where and from where process is getting ahead and that may be a reason for your timeout error.

Do this and let us know.
[ March 16, 2006: Message edited by: Chetan Parekh ]
Varsha Pardeshi
Ranch Hand

Joined: Feb 27, 2006
Posts: 30
Originally posted by Chetan Parekh:
Varsha, this is the flow of your program

First JSP calls Second JSP calls Bean calls JavaClass.

Right?

Do one thing, add System.out.println() in all entities for the debugging purpose and run the program.

Now you will know from the log that control is passing from where to where and from where process is getting ahead and that may be a reason for your timeout error.

Do this and let us know.

[ March 16, 2006: Message edited by: Chetan Parekh ]


ok I had putted the debugging msgs. but not understood where exactly the problem is coming. I had given
response.sendRedirect() till this it is working fine, calling methods from bean also. but the msg on the Redirected page is not coming.

I will again try to find & let u know.
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Is Bean returns any value to the Second JSP? Are you able to print those values in SOP?
Varsha Pardeshi
Ranch Hand

Joined: Feb 27, 2006
Posts: 30
Originally posted by Chetan Parekh:
Is Bean returns any value to the Second JSP? Are you able to print those values in SOP?


Yes the values are returning from the Bean. I had printed them through SOP.
Varsha Pardeshi
Ranch Hand

Joined: Feb 27, 2006
Posts: 30
Originally posted by Varsha Pardeshi:


Yes the values are returning from the Bean. I had printed them through SOP.


Hello everyone I got the problem. The program was continuously iterating the loop & hence the Readtimeout error comes.
Any ways,

Thanks to everyone.

Regards,
Varsha
 
GeeCON Prague 2014
 
subject: ReadTimeOut Problem in Tomcat4