File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes No/empty Response from tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "No/empty Response from tomcat" Watch "No/empty Response from tomcat" New topic
Author

No/empty Response from tomcat

srikanth daggumalli
Greenhorn

Joined: Aug 13, 2007
Posts: 9
Hi All

I am facing a weird behaviour of tomcat in 7.0.12 version. Below are the details

My application is runnning on tomcat 7.0.12 version.

The flow of my application is
1. index.jsp is the first page which will take inputs from user and sends those inputs to proccess.java servlet
2. This proccess.java will process all the business logic and sents the output to Result.jsp page.
3. Result.jsp will show the result.

The first request after starting the server is working fine.But if the server sits idle for 15 to 20 mins without receiving any request then empty response showing in the Result.jsp and the logs showing no errors or no exceptions.

which means If the server is idle for some time then the first request that comes to tomcat getting failed without any errors or exceptions and also fails rarely for the second time but then from third request it is working normally (third request inputs are same as first request inputs).

Does any body have any idea about this strange behaviour of tomcat.

What is causing this problem? How should I further investigate it? What can I do to solve it?

Looking forward for response. Thanks in advance.

Thanks
Srikanth D



If there is any error in my coding then it won't work for the third time even.
srikanth daggumalli
Greenhorn

Joined: Aug 13, 2007
Posts: 9
Does anybody had any chance to look into this issue ? I am still facing the issue. It is not resolved yet.
Much appriciated for your responses. Thank you.

Regards,
Srikanth D
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16101
    
  21

Well, when we say "patience is a virtue", we normally don't expect people to be that virtuous! You've been waiting for a reply since April?

Tomcat isn't likely to be the problem here. I can't say without more information, but it sounds like your servlet is misbehaving.


Customer surveys are for companies who didn't pay proper attention to begin with.
srikanth daggumalli
Greenhorn

Joined: Aug 13, 2007
Posts: 9
Hi

Thanks for your reply.

I can say that this is the problem with the Tomcat because the same applciation is working fine in IBM WAS 6.1.

Here is the details:

Tomcat servering blank pages some times. which means....

I have started my server after starting the server the first request goes fine and the result will be displayed in Result.jsp(this is the output jsp file).

If I haven't run any request for 10 mins then the first request is getting failed result is blank jsp page.

Nothing has been reported in logs. I got only <html><body></body></body> as view source for the Result.jsp page.

I have searched through google and found many people are facing the similar issue but no answers has been found. Please find the links below.

http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valve

http://www.velocityreviews.com/forums/t147112-tomcat-compiles-jsp-but-all-i-get-is-blank.html

http://www.coderanch.com/t/465816/Tomcat/Tomcat-serving-Blank-Page-shows

http://serverfault.com/questions/354261/apache-reverse-proxy-with-virtualhost-not-serving-a-page

http://forums.opensuse.org/english/other-forums/development/programming-scripting/401227-tomcat-displaying-blank-pages.html

http://ubuntuforums.org/showthread.php?t=420034


But in the Tomcat forums I have found similar kind of problem and they fixed and implemented on 7.0.28 version of tomcat.
Please find the link below

https://issues.apache.org/bugzilla/show_bug.cgi?id=53366

But right now I am using 7.0.29 version tomcat. But still the problem exists.

Regards,
Srikanth D
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16101
    
  21

I recommend that you read the contents of the pages that you listed and meditate on what they say. In almost all cases, the root cause of their problems was an application bug.

The actual bugzilla report related to a specialized Tomcat security configuration option that you probably aren't using (I've only used it once, myself) and resulted in a traceable fault.

Just because a defective app works in one server or one version of a server is no guarantee that it will work properly in all J2EE-compliant servers. This is especially true when there are differences in the versions of the J2EE standards being implemented. WAS 6.1 is nearly at end-of-life and requires major patches just to properly run JSF+JPA. Tomcat7 is so new that a lot of us haven't yet converted over. I only have one Tomcat7 in operation myself, and I tend to keep towards the leading edge on technology.

Tomcat has a very high reputation for reliability, so any bugs in its in basic processing would make major headlines, and anything outstanding for this long would almost certainly cause a very public outcry. That makes the odds overwhelmingly in favor of the fault being an application bug, not a Tomcat bug.

Unfortunately, we don't have enough information about what your code is really doing to be able to suggest anything. If you are actually getting the sequence of HTML back that you say you are, I can state with virtual certainty that it's an app bug. Firstly, because Tomcat neither generates nor comprehends HTML, so any HTML coming back is coming back from the application. Secondly because this isn't just empty HTML, it's malformed HTML.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10146
    
165

srikanth daggumalli wrote:

How should I further investigate it?



Since the issue hasn't yet been narrowed down, you have numerous ways to try and do it. For example, since it's the Result.jsp which seems to be running into problem, you can just change it completely and leave out all the dynamic content in it and just display a hello message in the body. Now once that works, you know that the .jsp has some problem. Then start investigating at what the .jsp contains and what part of it is causing problem.

[My Blog] [JavaRanch Journal]
srikanth daggumalli
Greenhorn

Joined: Aug 13, 2007
Posts: 9
Hi Tim,

Thanks for your reply.

I have deployed the same project code in WAS 7.0 also and it is working fine without any errors or exceptions.

As you said if it is a problem with the Application then it should not work for any request. But in my case it is working fine for some requests and not for on occassion. And in the links that I posted for reference they are using some JSFs in their code but in my case i am using only simple servelts and JSP's.

flow is like this..

1. index.jsp is the first jsp page and it will take the input and passit to servletOne.java
2. where servletOne.java passes and process the request to a thread program ... say servletThread.java (thread is to process the request only for 10 sec.. if above that it will terminate the process and shows a customized message in Result.jsp) ... and we are keeping this thread output in a POJO (someBean.java)
3. and the bean will be accessed in Result.jsp and will display the process result (all the time the bean is values to populate them to Result.jsp, I can see that from logs..).

More information regarding my hosting

I am using XEN VPS (virtual private server) account. where I can install and can do all the modification that I want in the server.


Hi Jai

Thanks for your reply.

I tried the same.. that I have placed only one System.out.println("Hello...") message in Result.jsp and watched the logs... but it is not printing for some times ... and printing some times....

In the case of problem I can see the last log message(servletOne.java) in the logs before directing to Result.jsp.

Any other ideas ?

Regards,
Srikanth Daggumalli.




 
GeeCON Prague 2014
 
subject: No/empty Response from tomcat