在 WebSphere Application Server 上部署时 OperatingSystemMXBean is not a valid MXBean interface 错误

OperatingSystemMXBean is not a valid MXBean interface error when deploying on WebSphere Application Server

在 WebSphere Application 服务器中部署和执行我的应用程序时,出现以下错误消息。

[6/1/21 17:44:24:958 CDT] 0000004e webapp        E com.ibm.ws.webcontainer.webapp.WebApp notifyServletContextCreated SRVE0283E: Exception caught while initializing context: {0}
                                 java.lang.ExceptionInInitializerError
    at java.lang.J9VMInternals.ensureError(J9VMInternals.java:141)
    at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:130)
    at java.lang.Class.forNameImpl(Native Method)
    at java.lang.Class.forName(Class.java:278)
    at com.transform.cartridge.volpayreferencedatautil.VolPayReferenceDataUtilFunctions.addTimeLog(VolPayReferenceDataUtilFunctions.java:204)
    at com.transform.flow.logaudit.LogAudit.Custom3Activity(LogAudit.java:100)
    at com.transform.flow.logaudit.LogAudit.executeInternal(LogAudit.java:152)
    at com.transform.flow.logaudit.LogAudit.run0(LogAudit.java:115)
    at com.tplus.transform.runtime.AbstractMessageFlow.run(AbstractMessageFlow.java:157)
    at com.tplus.transform.runtime.volante.MessageFlowVolante.run(MessageFlowVolante.java:75)
    at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start0(DeclarativeTransactionalExecutor.java:137)
    at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start(DeclarativeTransactionalExecutor.java:113)
    at com.tplus.transform.runtime.volante.MessageFlowVolante.run(MessageFlowVolante.java:73)
    at com.tplus.transform.runtime.proxy.MessageFlowProxy.run(MessageFlowProxy.java:32)
    at com.transform.flow.logaudit_sys_debug_instr.LogAudit_Sys_Debug_Instr.Invoke1Activity(LogAudit_Sys_Debug_Instr.java:41)
    at com.transform.flow.logaudit_sys_debug_instr.LogAudit_Sys_Debug_Instr.executeInternal(LogAudit_Sys_Debug_Instr.java:82)
    at com.transform.flow.logaudit_sys_debug_instr.LogAudit_Sys_Debug_Instr.run0(LogAudit_Sys_Debug_Instr.java:53)
    at com.tplus.transform.runtime.AbstractMessageFlow.run(AbstractMessageFlow.java:157)
    at com.tplus.transform.runtime.volante.MessageFlowVolante.run(MessageFlowVolante.java:75)
    at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start0(DeclarativeTransactionalExecutor.java:137)
    at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start(DeclarativeTransactionalExecutor.java:113)
    at com.tplus.transform.runtime.volante.MessageFlowVolante.run(MessageFlowVolante.java:73)
    at com.tplus.transform.runtime.proxy.MessageFlowProxy.run(MessageFlowProxy.java:32)
    at com.transform.flow.volantepaymentenginestartofprocess.VolantePaymentEngineStartOfProcess.Invoke4Activity(VolantePaymentEngineStartOfProcess.java:77)
    at com.transform.flow.volantepaymentenginestartofprocess.VolantePaymentEngineStartOfProcess.executeInternal(VolantePaymentEngineStartOfProcess.java:325)
    at com.transform.flow.volantepaymentenginestartofprocess.VolantePaymentEngineStartOfProcess.run0(VolantePaymentEngineStartOfProcess.java:300)
    at com.tplus.transform.runtime.AbstractMessageFlow.run(AbstractMessageFlow.java:157)
    at com.tplus.transform.runtime.volante.MessageFlowVolante.run(MessageFlowVolante.java:75)
    at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start0(DeclarativeTransactionalExecutor.java:137)
    at com.tplus.transform.runtime.volante.DeclarativeTransactionalExecutor.start(DeclarativeTransactionalExecutor.java:113)
    at com.tplus.transform.runtime.volante.MessageFlowVolante.run(MessageFlowVolante.java:73)
    at com.tplus.transform.runtime.proxy.MessageFlowProxy.run(MessageFlowProxy.java:32)
    at com.volantetech.volante.services.StartOfProcess.process(StartOfProcess.java:45)
    at com.volantetech.volante.services.ApplicationStartupListener.contextInitialized(ApplicationStartupListener.java:218)
    at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1837)
    at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:443)
    at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
    at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)
    at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:904)
    at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:789)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:427)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:719)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1249)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1591)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:708)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:1162)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:801)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.run(ApplicationMgrImpl.java:2325)
    at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5536)
    at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5662)
    at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2330)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:436)
    at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:379)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access0(CompositionUnitMgrImpl.java:127)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:985)
    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:524)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1909)
Caused by: java.lang.IllegalArgumentException: com.sun.management.OperatingSystemMXBean is not a valid MXBean interface.
    at java.lang.management.ManagementFactory.getPlatformMXBean(ManagementFactory.java:469)
    at com.volantetech.volante.services.performance.log.LogTime.<init>(LogTime.java:23)
    at com.volantetech.volante.services.performance.log.LogTime.<clinit>(LogTime.java:20)
    ... 57 more

服务器是带有 WebSphere 9.0.5.5 和 java openjdk 版本“1.8.0_292”的 RHEL 该应用程序的开发使其从消息队列中获取消息并对其进行处理。使用的消息队列是 IBM MQ 9.1.1.0。应用程序正在获取消息但未正确处理它们。该错误出现在启动和执行时。

任何指导都将非常有价值。

您的应用程序正在使用 openjdk 1.8 编译时,AppServer 似乎正在使用 OpenJ9。 Perhaps 您在 WAS ManagementFactory 中出现不匹配。尝试“ps -fea”并检查正在使用的 jvm。

通过在 Websphere 执行级别安装和配置 java JRE 1.8 版解决了这个问题。