首页 > 解决方案 > Jboss EAP 7.1 ServiceModuleLoader 返回 null

问题描述

我正在使用 Jboss EAP 7.1,当我尝试从 ServiceModuleLoader 转储AllModuleInformation 时,出现空指针异常,但是我可以看到 LocalModuleLoader 的结果。在下面附加堆栈跟踪。

基本上我正在尝试查看我的战争文件的所有加载资源。我真的不确定空指针异常的原因是什么。所有其他操作,如 dumpModuleInformation、getDependencies、getModuleDescription、getModulesPathInfo、refreshResourceLoaders、重新链接和 unLoadModule 抛出 IllegalArguementException:模块规范为空。只有 queryLoadedModuleNames 返回我的战争文件名。应用程序运行良好,没有任何问题。Jconsole 也抛出了同样的异常。我需要找到一种方法来查看我的战争文件的所有加载的 jar。独立服务器托管有多个战争文件,因此计划编写一个 JMX 程序来获取我所有战争/耳朵的加载依赖项。你们能帮我解决这个问题吗

javax.management.RuntimeMBeanException: java.lang.NullPointerException
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:839)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:852)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:821)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:1503)
    at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:724)
    at org.jboss.as.jmx.BlockingNotificationMBeanServer.invoke(BlockingNotificationMBeanServer.java:168)
    at org.jboss.remotingjmx.protocol.v2.ServerProxy$InvokeHandler.handle(ServerProxy.java:950)
    at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1$1.run(ServerCommon.java:153)
    at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:75)
    at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:70)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:92)
    at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor.handleEvent(ServerInterceptorFactory.java:70)
    at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:149)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
    at org.jboss.modules.ModuleLoader$MXBeanImpl.doGetResourceLoaders(ModuleLoader.java:857)
    at org.jboss.modules.ModuleLoader$MXBeanImpl.getModuleDescription(ModuleLoader.java:866)
    at org.jboss.modules.ModuleLoader$MXBeanImpl.doDumpModuleInformation(ModuleLoader.java:737)
    at org.jboss.modules.ModuleLoader$MXBeanImpl.dumpAllModuleInformation(ModuleLoader.java:725)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
    at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source

标签: jbossjmxjboss-eap-7

解决方案


推荐阅读