2011년 9월 7일 수요일

[WebSphere] System.exit() Call

WAS에서 실행하는 Application에서 System.exit()를 호출하는 어떻게 될까요?
답은 WAS instance (JVM)이 정지됩니다.
프로그램에서 별도로 java process를 실행시키는 환경이라면 모르겠으나
WAS에서 System.exit()를 호출하는 것은 instance를 shutdown 시키는 일이니 개발시 주의가 필요합니다.
그럼 어떻게 System.exit()가 호출되는지 찾을 수 있을까요?
아래 link 참고 바랍니다.

How to trace if code is calling 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 7.0:
-Xtrace:trigger=method{java/lang/System.exit,javadump}

For IBM® WebSphere® Application Server V6.0 and earlier:
Dibm.dg.trc.trigger=method(java/lang/System.exit,javadump)


Java process exits without leaving a footprint or no system core dump in WebSphere Application Server log file


Problem(Abstract)
You notice a Java™ process exits without a system core or userdump and no entry in the logs.

Cause
There could be several causes of a Java process exiting without a footprint (no core file produced on UNIX or no user.dmp file produced on Windows) :
 1. The nodeagent has restarted the unresponsive server.
 2. Java Native Interface (JNI) code has called JVM to shutdown.
 3. Some code has called System.exit().

댓글 없음:

댓글 쓰기