Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat shutdown  RSS feed

 
mohammad shadab
Ranch Hand
Posts: 62
Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My tomcat is getting shutdown on its own without telling any reason or showing nay error message , I have researched and found there could be two reason
1) Memory getting exhausted (out of memory problem)  , to identify this i am using java settings to give me heap dump whenever this error occurs.
2) Some library is calling System.exit - I am not able to trace this call.

Please let me know if we can find out the class calling System.exit?

Thank You.
 
Norm Radder
Rancher
Posts: 2240
28
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
find out the class calling System.exit?

Is your tomcat started with a commandline that executes the java command like this one:
"C:\Program Files\Java\jdk1.8.0_60\jre\bin\java.exe" -cp bootstrap.jar;tomcat-juli.jar org.apache.catalina.startup.Bootstrap start

An idea to trap who is calling System.exit() would  be to write a bootstrap program that sets a custom Security Manager that would trap any call to System.exit() and give a stack trace
 
Rob Spoor
Sheriff
Posts: 21114
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to necessarily need to write a bootstrap program for that. Just telling Tomcat to use a security manager with a specific security policy that forbids calling System.exit would probably also work.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!