javax.management.InstanceAlreadyExistsException: org.mongodb.driver:type=ConnectionPool,clusterId=3,host=localhost,port=27017

JIRA | Alexej Kubarev | 3 years ago
  1. 0

    When running several WAR files under one appserver, and both WAR files create one or several MongoClient instances, with 2.12.0-rc0 we start seeing {code} WARNING: Unable to register MBean org.mongodb.driver:type=ConnectionPool,clusterId=3,host=localhost,port=27017 javax.management.InstanceAlreadyExistsException: org.mongodb.driver:type=ConnectionPool,clusterId=3,host=localhost,port=27017 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 com.mongodb.util.management.jmx.JMXMBeanServer.registerMBean(JMXMBeanServer.java:59) at com.mongodb.JMXConnectionPoolListener.connectionPoolOpened(JMXConnectionPoolListener.java:52) at com.mongodb.PooledConnectionProvider.<init>(PooledConnectionProvider.java:60) at com.mongodb.DefaultClusterableServerFactory.create(DefaultClusterableServerFactory.java:50) at com.mongodb.BaseCluster.createServer(BaseCluster.java:202) at com.mongodb.SingleServerCluster.<init>(SingleServerCluster.java:45) at com.mongodb.Clusters.create(Clusters.java:37) at com.mongodb.DBTCPConnector.start(DBTCPConnector.java:75) at com.mongodb.Mongo.<init>(Mongo.java:346) at com.mongodb.Mongo.<init>(Mongo.java:327) at com.mongodb.MongoClient.<init>(MongoClient.java:268) at com.mongodb.Mongo$Holder.connect(Mongo.java:782) {code} This happens for the second WAR file starting (first one works fine, even though it started several instances of MongoClient). If we load only one of the WAR files (no matter which) this does not happen. This is working fine if using 2.11.4 (and a few earlier versions, for sure) of the driver but broke in 2.12.0-rc0

    JIRA | 3 years ago | Alexej Kubarev
    javax.management.InstanceAlreadyExistsException: org.mongodb.driver:type=ConnectionPool,clusterId=3,host=localhost,port=27017
  2. 0

    Getting exception while refreshing Spring ApplicationContext in Spring Boot application

    Stack Overflow | 2 years ago | user1514499
    org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.springframework.integration.monitor.IntegrationMBeanExporter@16c5464] with key 'integrationMbeanExporter'; nested exception is javax.management.InstanceAlreadyExistsException: org.springframework.integration.monitor:name=integrationMbeanExporter,type=IntegrationMBeanExporter
  3. 0

    Developer tools: problems reloading context

    GitHub | 2 years ago | dsyer
    java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Reloading in tomcat doesn't work due to previously-registered MBeans

    GitHub | 3 years ago | Multilineal
    javax.management.InstanceAlreadyExistsException: com.p6spy.engine.logging:name=P6LogOptions
  6. 0

    register druid-driver mbean error

    GitHub | 2 years ago | 423272190
    javax.management.InstanceAlreadyExistsException: com.alibaba.druid:type=MockDriver

  1. batwalrus76 2 times, last 2 weeks ago
  2. Handemelindo 1 times, last 2 weeks ago
  3. kjhdofjosvs 2 times, last 3 weeks ago
  4. tvrmsmith 2 times, last 1 month ago
  5. davidvanlaatum 54 times, last 2 months ago
3 more registered users
21 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. javax.management.InstanceAlreadyExistsException

    org.mongodb.driver:type=ConnectionPool,clusterId=3,host=localhost,port=27017

    at com.sun.jmx.mbeanserver.Repository.addMBean()
  2. Java RT
    JmxMBeanServer.registerMBean
    1. com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
    2. com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
    3. com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
    4. com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
    5. com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
    6. com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
    6 frames
  3. org.eclipse.orbit.mongodb_2.10.1.v20130422-1135.jar
    JMXMBeanServer.registerMBean
    1. com.mongodb.util.management.jmx.JMXMBeanServer.registerMBean(JMXMBeanServer.java:59)
    1 frame
  4. MongoDB Java Driver
    Mongo$Holder.connect
    1. com.mongodb.JMXConnectionPoolListener.connectionPoolOpened(JMXConnectionPoolListener.java:52)
    2. com.mongodb.PooledConnectionProvider.<init>(PooledConnectionProvider.java:60)
    3. com.mongodb.DefaultClusterableServerFactory.create(DefaultClusterableServerFactory.java:50)
    4. com.mongodb.BaseCluster.createServer(BaseCluster.java:202)
    5. com.mongodb.SingleServerCluster.<init>(SingleServerCluster.java:45)
    6. com.mongodb.Clusters.create(Clusters.java:37)
    7. com.mongodb.DBTCPConnector.start(DBTCPConnector.java:75)
    8. com.mongodb.Mongo.<init>(Mongo.java:346)
    9. com.mongodb.Mongo.<init>(Mongo.java:327)
    10. com.mongodb.MongoClient.<init>(MongoClient.java:268)
    11. com.mongodb.Mongo$Holder.connect(Mongo.java:782)
    11 frames