Reputation:
I have uploaded a website which have been developed with Java on a web hosting. I have uploaded it on tomcat server. Every 41 minutes just, I get 503 error and I must run startup.sh
script. I have detected it via program java which I have created. I suspect that a robot or a script in tomcat stops tomcat every 41 minutes.
What do you believe and what do you suggest to do?
I'm afraid of someone has hacked me because of tomcat stops every 41 minutes just!
Upvotes: 0
Views: 216
Reputation: 49
Recently I had this problem, If somebody faces the same issue in future I hope this will help.
Scenario: Tomcat shuts down without any logs or errors
1)Root Cause for my problem: synchronized method accessed from a task using TimerTask
2)I had a singleton class with a synchronized method accessed from various threads based on timer or user action some times this method will take up to few minutes to complete. When TimerTask is waiting on this method for sometime (I guess timer is timed out /thread is killed or something is happening in the background) and the moment the lock on the method is released the tomcat is getting killed.
So I removed synchronized keyword and removed singleton and made some code changes for thread safety. Then the problem is gone.
How I found out: I had a log statement in the first line of synchronized method and everytime the tomcat shutdowns i found this message in the last few lines.
Check if this helps:http://www.vineetmanohar.com/2010/06/howto-auto-recover-tomcat-crashes/
Upvotes: 2