spring - 如何在 Websphere ND 8.5 中运行 Spring Batch 管理

标签 spring websphere spring-batch jmx spring-batch-admin

有人真的设法在 Websphere 8.5 ND 中运行 Spring Batch Admin 吗?我花了大约 50 个小时在 Websphere ND 8.5 中运行最简单的 Spring Batch Admin,并且我可以找到其他任何方法来尝试修复

“创建名为“mbeanExporter”的 bean 时出错...无法使用键“integrationMBeanExporter”注册 MBean [org.springframework.integration.monitor.IntegrationMBeanExporter@65e7255d]”

请在阅读了我在论坛中找到的所有相关内容后,看看我所做的一切:

1) Spring Batch on Clustered environment - Websphere 它说SpringBatch不支持任何集群执行方式。嗯,我不依赖集群执行,也不依赖任何时间表。我只是尝试启动 Spring Batch 管理控制台,然后收到此类integrationMBeanExporter 错误。换句话说,我没有看到 Spring Batch Admin 启动,所以我还没有触发任何作业。

2) https://jira.spring.io/browse/BATCHADM-169 它说了两个有趣的陈述,但它们根本没有改变错误 (2.1) - 使用 PARENT_LAST 的类加载顺序。我为服务器和应用程序都这样做了。没有错误的变化。 (2.2) - 使用此处找到的确切 jar 版本 http://docs.spring.io/spring-batch-admin/spring-batch-admin-sample/dependencies.html 。我正在使用它。事实上,我正在尝试使用 Spring Batch Admin (spring-batch-admin-sample) 内部提供的示例,它包含完全相同的 jar 版本。在我本地的 Websphere Liberty Profile 中,这样的示例 spring-batch-admin-sample 运行完美,但是当部署到 Websphere ND 时,它给出了相同的集成MBeanExporter 错误

3 - https://www.intertech.com/Blog/spring-batch-admin-tutorial/ 我按照这样的分步教程进行操作,可以在本地 Websphere Liberty Profile 中运行,但在 Websphere ND 中运行时出现相同的集成MBeanExporter 错误。

4 - 当我向本地 Websphere Liberty Profile 部署两个 Spring Batch Admin 时,我可以在本地 Websphere Liberty Profile 中重现相同的 IntegrationMBeanExporter 错误。好吧,为了确保这不是问题,我从 Websphere ND Server 中删除了所有其他应用程序,只留下一个 Spring Batch Admin。相同的集成MBeanExporter 引发。

5 - 在我的本地 Websphere Liberty 中,当我遵循 Deploying two Spring batch applications in same cluster in a single Weblogic Domain? 中的建议时,我修复了由于有两个 Spring Batch Admin 导致的 IntegrationMBeanExporter 问题。 。我的意思是,我创建了

<int-jmx:mbean-export id="integrationMBeanExporter" default-domain="SpringBatchAdmin" server="mbeanServer" />
<context:mbean-export default-domain="SpringBatchAdmin" server="mbeanServer" />

在我本地 WAS Liberty 的两个应用程序之一中,它解决了问题并允许我在同一服务器中打开两个 Spring Batch Admin。好吧,在 Websphere ND 中,我已经删除了除 Spring Batch Admin 之外的所有应用程序,因此按照我尝试的方式,这对我来说没有多大意义,而且它根本没有改变错误。

看来我可以非常轻松地在与 Websphere ND 8.5.5 不同的任何 Web 容器中启动和运行 SPring Batch Admin。我猜,但我不确定是否存在某种方法可以通过简单的配置来修复此类错误,但我可以想象还可以尝试什么。

整个错误:

[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)

最佳答案

我的项目中也遇到了类似的问题,花了将近一周的时间才确定原因,我的情况的根本原因只是因为添加了依赖项。

   <dependency>
       <groupId>com.ibm.websphere.appserver.runtime</groupId>
           <artifactId>com.ibm.ws.admin.client</artifactId>
        <version>7.0.0</version>
    </dependency>

上述依赖项在 tomcat 中工作正常,但在 WAS Liberty 服务器中却无法正常工作。

<exclusions>
     <exclusion>
        <artifactId>com.ibm.ws.webservices.thinclient_7.0.0</artifactId>
        <groupId>serverwas85</groupId>
    </exclusion>
</exclusions>

希望这能解决您的问题。(因为此排除特定于我的应用程序,如果有人面临类似问题,则添加作为引用。如果您没有任何此类相对依赖性,请忽略它)

关于spring - 如何在 Websphere ND 8.5 中运行 Spring Batch 管理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39432442/

相关文章:

java - 为什么我使用 Spring Boot/Spring Social 指南示例获得到 Twitter 的空连接?

java - IBM的JVM还在使用绿色线程?

java - 如何在Websphere中设置log4j.properties文件的相对路径

java - Spring Batch 异步处理器配置以获得最佳性能

java - 让 Broadleaf 在单元测试中运行

java - 使用谷歌日历 API 发送邀请

java - Spring RESTful webservice Hibernate/JPA Crudrepository - 按电影标题获取用户

java - WebSphere 7 HTTPSession 实现是否违反了 J2EE 规范?

java - Spring batch - 如何使用 ThreadPoolTask​​Executor 动态增加和减少线程

spring - 使用Spring批处理从HDFS读取文件