• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat shutdown

 
mohammad shadab
Ranch Hand
Posts: 52
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: 1648
22
  • 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: 20831
68
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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!