Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1117

2.12.0-rc0 logs JMX InstanceAlreadyExistsException at WARNING level

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.12.0
    • Affects Version/s: 2.12.0
    • Component/s: Monitoring
    • Labels:
    • Environment:
      JDK 7u51 (Linux and OSX)
    • Fully Compatible

      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

      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)
      

      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

            Assignee:
            Unassigned Unassigned
            Reporter:
            alexej.kubarev@accedo.tv Alexej Kubarev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: