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.
If there is any error in my coding then it won't work for the third time even.
Joined: Aug 13, 2007
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.
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.
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.
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.
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.