WebSphere Application Server中发布的程序中调用System.exit()

如将java EE应用程序发布到was appserver中,如果这些代码中有调用System.exit(),会停掉JVM,那么会导致appserver失效,就是这个应用服务器停止服务。

 

按照IBM网站的说法是

When System.exit() (http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#exit(int)) 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.

 

如果这个appserver是集群中的一个节点,那么这个节点会掉。再发布或者卸载应用的时候都会很慢,这时候,需要重新启动节点所在机器。重新启动或者卸载应用。

 

如果想应用服务器在执行这些代码后有日志记录是哪些代码调用了System.exit(),可以

以下是从IBM抓来的一段

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 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)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值