WebSphere Traditional应用服务器重启失败,报AdminException空指针异常
WebSphere Traditional重启启动时NullPointerException异常分析
我正尝试通过Rational Application Developer启动WebSphere Traditional应用服务器,首次启动运行正常,但次日停止服务器后再次启动时,控制台抛出如下异常:
[12/7/22 14:47:15:934 IST] 00000001 SystemErr R com.ibm.websphere.management.exception.AdminException: java.lang.NullPointerException [12/7/22 14:47:15:935 IST] 00000001 SystemErr R at com.ibm.ws.management.MBeanFactoryImpl.deactivateMBean(MBeanFactoryImpl.java:1168) [12/7/22 14:47:15:935 IST] 00000001 SystemErr R at com.ibm.ws.batch.endpointsensor.BatchSensorComponent.destroy(BatchSensorComponent.java:100) [12/7/22 14:47:15:935 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ContainerHelper.destroyComponent(ContainerHelper.java:341) [12/7/22 14:47:15:935 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ContainerHelper.destroyComponents(ContainerHelper.java:325) [12/7/22 14:47:15:935 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ContainerImpl.destroyComponents(ContainerImpl.java:607) [12/7/22 14:47:15:935 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ContainerImpl.destroy(ContainerImpl.java:598) [12/7/22 14:47:15:935 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ServerImpl.destroy(ServerImpl.java:501) [12/7/22 14:47:15:935 IST] 00000001 SystemErr R at com.ibm.ws.runtime.WsServerImpl.bootServerContainer(WsServerImpl.java:334) [12/7/22 14:47:15:936 IST] 00000001 SystemErr R at com.ibm.ws.runtime.WsServerImpl.start(WsServerImpl.java:238) [12/7/22 14:47:15:936 IST] 00000001 SystemErr R at com.ibm.ws.runtime.WsServerImpl.main(WsServerImpl.java:711) [12/7/22 14:47:15:936 IST] 00000001 SystemErr R at com.ibm.ws.runtime.WsServer.main(WsServer.java:59) [12/7/22 14:47:15:936 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [12/7/22 14:47:15:936 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90) [12/7/22 14:47:15:936 IST] 00000001 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) [12/7/22 14:47:15:936 IST] 00000001 SystemErr R at java.lang.reflect.Method.invoke(Method.java:508) [12/7/22 14:47:15:936 IST] 00000001 SystemErr R at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:234) [12/7/22 14:47:15:936 IST] 00000001 SystemErr R at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:101) [12/7/22 14:47:15:936 IST] 00000001 SystemErr R at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:82) [12/7/22 14:47:15:937 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [12/7/22 14:47:15:937 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90) [12/7/22 14:47:15:937 IST] 00000001 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) [12/7/22 14:47:15:937 IST] 00000001 SystemErr R at java.lang.reflect.Method.invoke(Method.java:508) [12/7/22 14:47:15:937 IST] 00000001 SystemErr R at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) [12/7/22 14:47:15:937 IST] 00000001 SystemErr R at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) [12/7/22 14:47:15:937 IST] 00000001 SystemErr R at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) [12/7/22 14:47:15:937 IST] 00000001 SystemErr R at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) [12/7/22 14:47:15:937 IST] 00000001 SystemErr R at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) [12/7/22 14:47:15:937 IST] 00000001 SystemErr R at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181) [12/7/22 14:47:15:937 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [12/7/22 14:47:15:938 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90) [12/7/22 14:47:15:938 IST] 00000001 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) [12/7/22 14:47:15:938 IST] 00000001 SystemErr R at java.lang.reflect.Method.invoke(Method.java:508) [12/7/22 14:47:15:938 IST] 00000001 SystemErr R at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340) [12/7/22 14:47:15:939 IST] 00000001 SystemErr R at org.eclipse.core.launcher.Main.basicRun(Main.java:282) [12/7/22 14:47:15:939 IST] 00000001 SystemErr R at org.eclipse.core.launcher.Main.run(Main.java:981) [12/7/22 14:47:15:939 IST] 00000001 SystemErr R at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:423) [12/7/22 14:47:15:939 IST] 00000001 SystemErr R at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:180) [12/7/22 14:47:15:939 IST] 00000001 SystemErr R Caused by: java.lang.NullPointerException [12/7/22 14:47:15:939 IST] 00000001 SystemErr R at com.ibm.ws.management.MBeanFactoryImpl.deactivateMBean(MBeanFactoryImpl.java:1141) [12/7/22 14:47:15:940 IST] 00000001 SystemErr R ... 36 more
异常原因
从堆栈跟踪可以定位到,NullPointerException发生在MBeanFactoryImpl.deactivateMBean方法中,由BatchSensorComponent.destroy()触发。核心问题是服务器停止时MBean资源未被正确清理,导致重启过程中尝试注销一个已经不存在或被释放的MBean实例。
常见触发场景:
- 上次服务器停止为非正常关闭(强制杀死进程、断电等),导致MBean注册表残留无效记录
- Batch传感器组件的生命周期管理存在缺陷,重启时重复执行销毁逻辑
- 服务器配置文件(如
server.xml)在停止后出现损坏或状态不一致
修复步骤
- 清理临时缓存:删除WebSphere服务器实例下的
temp和work目录(路径一般为[WAS安装目录]/profiles/[你的配置文件]/temp、[WAS安装目录]/profiles/[你的配置文件]/work),清理后重新启动服务器 - 规范停止流程:后续停止服务器时使用正规方式,比如在Rational Application Developer中点击停止按钮,或执行
stopServer.bat/stopServer.sh脚本,避免强制终止进程 - 重置服务器配置:如果清理缓存无效,可以通过RAD重新生成服务器实例,或恢复到首次启动时的配置状态
- 更新补丁:若为WebSphere已知bug,检查对应版本的Fix Pack,安装最新补丁修复Batch组件的生命周期问题
内容的提问来源于stack exchange,提问作者KUNAL HIRANI
相关产品推荐
相关产品推荐

