Search code examples
tomcatapache-camelhawtio

hawtio InstanceAlreadyExistsException type=security name=RBACRegistry


I tried running an example Camel application with hawtio which is listed in Hawtio getting stated page (http://hawt.io/getstarted/index.html) on Tomcat 8, and got the exception,

SEVERE: Exception sending context initialized event to listener instance of class io.hawt.HawtioContextListener java.lang.RuntimeException: javax.management.InstanceAlreadyExistsException: hawtio:type=security,name=RBACRegistry at io.hawt.HawtioContextListener.createServletException(HawtioContextListener.java:61) at io.hawt.HawtioContextListener.contextInitialized(HawtioContextListener.java:40) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4842) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: javax.management.InstanceAlreadyExistsException: hawtio:type=security,name=RBACRegistry at com.sun.jmx.mbeanserver.Repository.addMBean(Unknown Source) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(Unknown Source) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(Unknown Source) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(Unknown Source) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(Unknown Source) at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(Unknown Source) at io.hawt.jmx.RBACRegistry.init(RBACRegistry.java:64) at io.hawt.HawtioContextListener.contextInitialized(HawtioContextListener.java:38) ... 9 more

Could someone please let me know what to do.


Solution

  • Caused by: javax.management.InstanceAlreadyExistsException: hawtio:type=security,name=RBACRegistry
    

    It happened because your hawtio was trying to register hawtio:type=security,name=RBACRegistry to the MBean registry at initialisation but found that it was already registered somewhere else. I suspect that you have more than one hawtio instance deployed on Tomcat. If so, make sure you deploy only one hawtio instance on one application server.

    If you are sure you deployed only one hawtio instance, then you need to check if hawtio:type=security,name=RBACRegistry really exists already by using some JMX client like JConsole to connect to the Tomcat server. Then find out where this MBean was registered.