how to register org.springframework.integration.monitor.IntegrationMBeanExporter

自作多情 提交于 2019-12-11 06:40:49

问题


According to http://www.ibm.com/support/knowledgecenter/en/SS7K4U_8.5.5/com.ibm.websphere.nd.multiplatform.doc/ae/cspr_data_access_tran2.html I "... must register the JMX MBeans with the MBeanServer instance of the container manager in the application server. If you do not specify a server property for the MBean, the MBeanExporter object attempts to detect an MBeanServer instance that is running".

I search on internet and I found few Hello World examples telling how to register a bean that I have coded. My case is a bit different. The bean in my question is IntegrationMBeanExporter provided by Spring and I must register it in certain Spring Xml Configuration (Spring Batch Admin relying on xml configurations instead of java configurations).

I can't find a simple example how to do it. I guess it is something using context:mbean-export and int-jmx:mbean-export. Kindly, see bellow my tentative but unfortunately it is not taken in effect by Websphere ND 8.5.5.

A possible reason is that I am not filling in properly context:mbean-export and int-jmx:mbean-export so any example working in any server will be high appreciatted.

I am using Websphere but if someone teach in any Enterprise Server it will probably be the same approach.

My root motivation is to fix this error. I think if I found how to register org.springframework.integration.monitor.IntegrationMBeanExporter it will certainly fix my problem.

Error:

[9/10/16 14:32:40:484 CDT]     FFDC Exception:org.springframework.beans.factory.BeanCreationException SourceId:com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated ProbeId:1341 Reporter:com.ibm.ws.webcontainer.webapp.WebAppImpl@a2268c26

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mbeanExporter':

Invocation of init method failed; nested exception is org.springframework.jmx.export.UnableToRegisterMBeanException:

Unable to register MBean [org.springframework.integration.monitor.IntegrationMBeanExporter@65e7255d] with key 'integrationMBeanExporter';

nested exception is javax.management.RuntimeOperationsException

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)

                at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)

                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)

                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)

                at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)

                at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)

                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)

                at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)

                at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)

                at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)

                at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1704)

                at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:411)

                at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)

                at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)

                at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)

                at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)

                at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)

                at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)

                at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1177)

                at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)

                at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)

                at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)

                at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:776)

                at com.ibm.ws.runtime.component.ApplicationMgrImpl$5.run(ApplicationMgrImpl.java:2195)

                at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5477)

                at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5603)

                at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)

                at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2200)

                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:435)

                at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)

                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:378)

                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:126)

                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:984)

                at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:502)

                at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881)

Caused by: org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.springframework.integration.monitor.IntegrationMBeanExporter@65e7255d] with key 'integrationMBeanExporter'; nested exception is javax.management.RuntimeOperationsException

                at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:610)

                at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:535)

                at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:417)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)

                ... 37 more

Caused by: javax.management.RuntimeOperationsException

                at com.ibm.ws.management.PlatformMBeanServer.registerMBean(PlatformMBeanServer.java:567)

                at org.springframework.jmx.support.MBeanRegistrationSupport.doRegister(MBeanRegistrationSupport.java:195)

                at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:663)

                at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:600)

                ... 41 more

Caused by: javax.management.JMRuntimeException: java.lang.reflect.UndeclaredThrowableException

                at com.ibm.CORBA.iiop.UtilDelegateImpl.mapSystemException(UtilDelegateImpl.java:242)

                at javax.rmi.CORBA.Util.mapSystemException(Util.java:78)

                at com.ibm.ws.management._ControlAdminService_Stub.activateProxyMBean(_ControlAdminService_Stub.java:168)

                at com.ibm.ws.management.PlatformMBeanServer.registerMBean(PlatformMBeanServer.java:515)

                at org.springframework.jmx.support.MBeanRegistrationSupport.doRegister(MBeanRegistrationSupport.java:195)

                at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:663)

                at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:600)

                at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:535)

                at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:417)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)

                at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)

                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)

                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)

                at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)

                at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)

                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)

                at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)

                at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)

                at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)

                at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1704)

                at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:411)

                at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)

                at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)

                at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)

                at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)

                at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)

                at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)

                at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1177)

                at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)

                at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)

                at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)

                at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:776)

                at com.ibm.ws.runtime.component.ApplicationMgrImpl$5.run(ApplicationMgrImpl.java:2195)

                at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5477)

                at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5603)

                at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)

                at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2200)

                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:435)

                at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)

                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:378)

                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:126)

                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:984)

                at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:502)

                at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881)

Caused by: java.lang.reflect.InvocationTargetException

                at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)

                at java.lang.reflect.Method.invoke(Method.java:620)

                at com.ibm.ws390.orb.RIRProtectedProxyHandler.invoke(RIRProtectedProxyHandler.java:192)

                at com.sun.proxy.$Proxy3._invoke(Unknown Source)

                at com.ibm.ws390.orb.CommonBridge.invoke(CommonBridge.java:1898)

                at com.ibm.ws390.orb.ORBEJSBridge.invoke(ORBEJSBridge.java:286)

                at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)

                at java.lang.reflect.Method.invoke(Method.java:620)

                at com.ibm.ws390.orb.parameters.ORBEJSBridgeInvoke.ORBEJSBridgeInvokeParmSetter(ORBEJSBridgeInvoke.java:234)

Caused by: org.omg.CORBA.portable.UnknownException:   vmcid: 0x0  minor code: 0 completed: Maybe

                at com.ibm.ws.management._ControlAdminServiceImpl_Tie._invoke(_ControlAdminServiceImpl_Tie.java:123)

回答1:


Looks like everything correct.

Although we use <context:mbean-server /> in addition in our test-cases.

Not sure if that should be a problem for you, but that it worth to check any way.

On the other hand I feel somehow that you have versions mismatch there since your project looks like Spring4, but Spring Batch Admin may rely on the Spring Integration 3.0. Consider to upgrade to spring-batch-admin-2.0.0.M1, which is based on the Spring Intgration 4.1.x already.



来源:https://stackoverflow.com/questions/39438251/how-to-register-org-springframework-integration-monitor-integrationmbeanexporter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!