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

alwaysUseMBeans is not honoured

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 2.11.2
    • Fix Version/s: None
    • Component/s: Monitoring
    • Labels:
      None

      Description

      As advised in JAVA-641, in order to use MBeans on Java 6 or greater alwaysUseMBeans has to be set to "true". Even if set, it may not work.

      Test case:

              MongoClientOptions.Builder builder = new MongoClientOptions.Builder();
              builder.alwaysUseMBeans(true);
              MongoClient mongoConn = new MongoClient(new MongoClientURI("mongodb://localhost:27017", builder));
              System.out.println(mongoConn.getMongoOptions().isAlwaysUseMBeans()); // Output: false

      Patch with a code fix is attached.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: