• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat shutdown

 
Ranch Hand
Posts: 67
Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 5008
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic