How to trace if code is calling System.exit()
How do I trace to see what code is calling System.exit() ?
When System.exit() is called by any code, it terminates the currently running Java™ Virtual Machine. An unexpected call to System.exit() by any code would lead to Java processes vanishing and the appserver will fail. Most of the time, this is considered as a crash without any footprint. Since it is a normal termination, no system core or javacore is created that would otherwise provide information about the problem.
The most probable reason for a crash without any footprint or core is that some code has called System.exit(). Since there is no footprint, there is no way to tell which piece of code called System.exit().
To find out which part of the application or server code has called System.exit(), enable the following trace in the appserver. This trace will generate a javacore whenever some code calls System.exit().
Note that a restart of the server is needed after enabling the traces. To enable this trace add the following in the Generic JVM arguments
- For IBM® WebSphere® Application Server V6.1 and higher:
- For IBM® WebSphere® Application Server V6.0 and earlier: -Dibm.dg.trc.trigger=method(java/lang/System.exit,javadump)
NOTE: There is a significant performance impact possible when this trace is enabled. This trace should only be implemented at the request of IBM Support and then removed when problem determination has been completed.
|Application Servers||WebSphere Application Server - Express||J2EE Development and deployment||AIX, Linux, Windows||8.5.5, 8.5, 8.0, 7.0, 6.1, 6.0.2|
More support for:
WebSphere Application Server
Software version: 6.0.2, 6.1, 7.0, 8.0, 8.5, 8.5.5, 9.0
Operating system(s): AIX, Linux, Windows
Reference #: 1303215
Modified date: 22 July 2008