-
Enhancement
-
Resolution: Done
-
Major
-
None
-
9.4.12.Final, 10.0.0.Beta4
-
None
-
None
-
JDG Sprint #27
-
Documentation (Ref Guide, User Guide, etc.), User Experience
org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.infinispan.client.hotrod.RemoteCacheManager@51a06cbe] with key 'remoteCacheManager'; nested exception is javax.management.InstanceAlreadyExistsException: MXBean already registered with name org.infinispan:type=HotRodClient,name=Default
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:625) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.jmx.export.MBeanExporter.lambda$registerBeans$2(MBeanExporter.java:551) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at java.util.HashMap.forEach(HashMap.java:1289) ~[na:1.8.0_201]
at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:551) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.jmx.export.MBeanExporter.afterSingletonsInstantiated(MBeanExporter.java:434) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:863) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
at me.ignaciosanchez.hotrodtester.HotrodTesterApplication.main(HotrodTesterApplication.java:10) [classes/:na]
Caused by: javax.management.InstanceAlreadyExistsException: MXBean already registered with name org.infinispan:type=HotRodClient,name=Default
at com.sun.jmx.mbeanserver.MXBeanLookup.addReference(MXBeanLookup.java:151) ~[na:1.8.0_201]
at com.sun.jmx.mbeanserver.MXBeanSupport.register(MXBeanSupport.java:160) ~[na:1.8.0_201]
at com.sun.jmx.mbeanserver.MBeanSupport.preRegister2(MBeanSupport.java:173) ~[na:1.8.0_201]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:930) ~[na:1.8.0_201]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900) ~[na:1.8.0_201]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324) ~[na:1.8.0_201]
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522) ~[na:1.8.0_201]
at org.springframework.jmx.support.MBeanRegistrationSupport.doRegister(MBeanRegistrationSupport.java:137) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:671) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:615) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
... 14 common frames omitted
We are using a Spring Boot application (with Spring Cache and Spring Session) and maybe this could be the problem. My configuration is:
@Bean
public InfinispanRemoteConfigurer infinispanRemoteConfigurer()
And I have also tried with this one:
@Bean
public SpringRemoteCacheManager cacheManager()
@Bean
public RemoteCacheManager infinispanCacheManager()
But both return me the same error.
Disable Spring JMX auto configuration: spring.jmx.enabled=false