Tomcat shuts down automatically

后端 未结 10 973
囚心锁ツ
囚心锁ツ 2020-12-14 09:43

I\'m using Apache and Tomcat on a Windows server and since this morning, Tomcat stops working without any logs. It doesn\'t hang, it just shut down.
There\'s no log in T

相关标签:
10条回答
  • 2020-12-14 10:05

    Sometime it happens if some other program is running on the same port. For example Skype. Shut down that program before you start Tomcat.

    0 讨论(0)
  • 2020-12-14 10:07

    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

    Root Cause for my problem: synchronized method accessed from a task using TimerTask

    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.

    Regards, Phanindra Kasturi

    0 讨论(0)
  • 2020-12-14 10:10

    things to look for in debugging an issue like this:

    • Look at the logs directory ($TOMCAT_ROOT/logs) to make sure none of the log files have any stack traces
    • Look at the tomcat startup script to make check the location of the log files to see if the logs are not being written to another directory.
    • Another reason could be some other user/process could be issuing a kill -9 that could kill tomcat without giving it any chance to log errors.
    0 讨论(0)
  • 2020-12-14 10:25

    Are your servlets or one of it's dependencies allowed to call System.exit()? (Not sure how locked down Tomcat VMs are in that sense)

    I've had developers thinking it's ok to use exit(666); on detecting a non-invertable matrix (which isn't good, but sure as heck not fatal). Arrgh. Perhaps you have some similar culprit in your system?

    0 讨论(0)
提交回复
热议问题