[JBoss JIRA] (ISPN-10111) Avoiding Duplicate MBean Registration with Spring
by Donald Naro (Jira)
[ https://issues.jboss.org/browse/ISPN-10111?page=com.atlassian.jira.plugin... ]
Donald Naro closed ISPN-10111.
------------------------------
Closing this issue. No doc changes needed upstream. This is a result of an issue with Spring Boot and fixed with https://github.com/karesti/spring-boot-infinispan-jmx/pull/1/files
Those changes will be included in the next version of the SB starter. Docs for the product handled with https://issues.jboss.org/browse/JDG-2677
> Avoiding Duplicate MBean Registration with Spring
> -------------------------------------------------
>
> Key: ISPN-10111
> URL: https://issues.jboss.org/browse/ISPN-10111
> Project: Infinispan
> Issue Type: Enhancement
> Affects Versions: 9.4.12.Final, 10.0.0.Beta4
> Reporter: Donald Naro
> Assignee: Donald Naro
> Priority: Major
>
> 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() {
> return () -> new ConfigurationBuilder()
> .addServer()
> .host(host)
> .port(Integer.parseInt(port))
> .statistics()
> .enable()
> .jmxEnable()
> .build();
> }
> And I have also tried with this one:
> @Bean
> public SpringRemoteCacheManager cacheManager() {
> return new SpringRemoteCacheManager(infinispanCacheManager());
> }
> @Bean
> public RemoteCacheManager infinispanCacheManager() {
> ConfigurationBuilder builder = new ConfigurationBuilder();
> builder.addServer()
> .host(host)
> .port(Integer.parseInt(port))
> .statistics()
> .enable()
> .jmxEnable();
> return new RemoteCacheManager(builder.build());
> }
> But both return me the same error.
> Disable Spring JMX auto configuration: spring.jmx.enabled=false
> https://docs.spring.io/spring-boot/docs/current/api/org/springframework/b...
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 9 months
[JBoss JIRA] (ISPN-10111) Avoiding Duplicate MBean Registration with Spring
by Donald Naro (Jira)
[ https://issues.jboss.org/browse/ISPN-10111?page=com.atlassian.jira.plugin... ]
Donald Naro updated ISPN-10111:
-------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
> Avoiding Duplicate MBean Registration with Spring
> -------------------------------------------------
>
> Key: ISPN-10111
> URL: https://issues.jboss.org/browse/ISPN-10111
> Project: Infinispan
> Issue Type: Enhancement
> Affects Versions: 9.4.12.Final, 10.0.0.Beta4
> Reporter: Donald Naro
> Assignee: Donald Naro
> Priority: Major
>
> 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() {
> return () -> new ConfigurationBuilder()
> .addServer()
> .host(host)
> .port(Integer.parseInt(port))
> .statistics()
> .enable()
> .jmxEnable()
> .build();
> }
> And I have also tried with this one:
> @Bean
> public SpringRemoteCacheManager cacheManager() {
> return new SpringRemoteCacheManager(infinispanCacheManager());
> }
> @Bean
> public RemoteCacheManager infinispanCacheManager() {
> ConfigurationBuilder builder = new ConfigurationBuilder();
> builder.addServer()
> .host(host)
> .port(Integer.parseInt(port))
> .statistics()
> .enable()
> .jmxEnable();
> return new RemoteCacheManager(builder.build());
> }
> But both return me the same error.
> Disable Spring JMX auto configuration: spring.jmx.enabled=false
> https://docs.spring.io/spring-boot/docs/current/api/org/springframework/b...
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 9 months
[JBoss JIRA] (ISPN-10111) Avoiding Duplicate MBean Registration with Spring
by Donald Naro (Jira)
[ https://issues.jboss.org/browse/ISPN-10111?page=com.atlassian.jira.plugin... ]
Donald Naro updated ISPN-10111:
-------------------------------
Git Pull Request: https://github.com/infinispan/infinispan/pull/6830, https://github.com/infinispan/infinispan/pull/6831, https://github.com/infinispan/infinispan/pull/6839 (was: https://github.com/infinispan/infinispan/pull/6830, https://github.com/infinispan/infinispan/pull/6831)
> Avoiding Duplicate MBean Registration with Spring
> -------------------------------------------------
>
> Key: ISPN-10111
> URL: https://issues.jboss.org/browse/ISPN-10111
> Project: Infinispan
> Issue Type: Enhancement
> Affects Versions: 9.4.12.Final, 10.0.0.Beta4
> Reporter: Donald Naro
> Assignee: Donald Naro
> Priority: Major
>
> 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() {
> return () -> new ConfigurationBuilder()
> .addServer()
> .host(host)
> .port(Integer.parseInt(port))
> .statistics()
> .enable()
> .jmxEnable()
> .build();
> }
> And I have also tried with this one:
> @Bean
> public SpringRemoteCacheManager cacheManager() {
> return new SpringRemoteCacheManager(infinispanCacheManager());
> }
> @Bean
> public RemoteCacheManager infinispanCacheManager() {
> ConfigurationBuilder builder = new ConfigurationBuilder();
> builder.addServer()
> .host(host)
> .port(Integer.parseInt(port))
> .statistics()
> .enable()
> .jmxEnable();
> return new RemoteCacheManager(builder.build());
> }
> But both return me the same error.
> Disable Spring JMX auto configuration: spring.jmx.enabled=false
> https://docs.spring.io/spring-boot/docs/current/api/org/springframework/b...
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 9 months
[JBoss JIRA] (ISPN-10120) Add spec descriptor for image
by Galder Zamarreño (Jira)
Galder Zamarreño created ISPN-10120:
---------------------------------------
Summary: Add spec descriptor for image
Key: ISPN-10120
URL: https://issues.jboss.org/browse/ISPN-10120
Project: Infinispan
Issue Type: Enhancement
Components: Operator
Reporter: Galder Zamarreño
Assignee: Galder Zamarreño
Operator scorecard warning:
{code}
SUGGESTION: Add a spec descriptor for image
{code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 9 months
[JBoss JIRA] (ISPN-10119) Make sure all resources are owned
by Galder Zamarreño (Jira)
Galder Zamarreño created ISPN-10119:
---------------------------------------
Summary: Make sure all resources are owned
Key: ISPN-10119
URL: https://issues.jboss.org/browse/ISPN-10119
Project: Infinispan
Issue Type: Enhancement
Components: Operator
Reporter: Galder Zamarreño
Assignee: Galder Zamarreño
Operator scorecard warning
{code}
SUGGESTION: Add resources to owned CRDs
{code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 9 months
[JBoss JIRA] (ISPN-10118) Add status field to Operator custom resource
by Galder Zamarreño (Jira)
Galder Zamarreño created ISPN-10118:
---------------------------------------
Summary: Add status field to Operator custom resource
Key: ISPN-10118
URL: https://issues.jboss.org/browse/ISPN-10118
Project: Infinispan
Issue Type: Enhancement
Components: Operator
Reporter: Galder Zamarreño
Assignee: Galder Zamarreño
Operator scorecard warning
{code}
SUGGESTION: Add a 'status' field to your Custom Resource
{code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 9 months