Re: prevent registering JCSAdminBean multiple times
On 16.11.17 21:54, Tim Cronin wrote: > we have a few webapps running on the same server that use JCS. > > when moving the 2.x we started getting the following error on tomcat startup > > > > javax.management.InstanceAlreadyExistsException: It looks like you load multiple instances of CompositeCacheManager from different class loaders. Setting the jmxName to different values is not possible at the moment. This should be configurable. Would you please open an issue on this. Bye, Thomas. - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
Re: prevent registering JCSAdminBean multiple times
Hi Tim Setting the jmxName to null on the composite cache manager should do the trick but depending the api you use is more or less easy. Can you have a look? Le 16 nov. 2017 21:54, "Tim Cronin"a écrit : we have a few webapps running on the same server that use JCS. when moving the 2.x we started getting the following error on tomcat startup javax.management.InstanceAlreadyExistsException: org.apache.commons.jcs:type=JCSAdminBean at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor. registerWithRepository(DefaultMBeanServerInterceptor.java:1898) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean( DefaultMBeanServerInterceptor.java:966) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject( DefaultMBeanServerInterceptor.java:900) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean( DefaultMBeanServerInterceptor.java:324) at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean( JmxMBeanServer.java:522) at org.apache.commons.jcs.engine.control.CompositeCacheManager.initialize( CompositeCacheManager.java:271) at org.apache.commons.jcs.engine.control.CompositeCacheManager.getInstance( CompositeCacheManager.java:185) at org.apache.commons.jcs.engine.control.CompositeCacheManager.getInstance( CompositeCacheManager.java:161) at org.apache.commons.jcs.JCS.getCacheManager(JCS.java:172) at org.apache.commons.jcs.JCS.getInstance(JCS.java:190) at com.outboundengine.cache.Cache.(Cache.java:42) at com.outboundengine.cache.CacheManager.(CacheManager.java:37) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance( NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423)