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

Using BasicDBObject.parse(String) on OpenJDK 11.0.8 yields NPE

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None

    Description

      Summary

      When using BasicDBObject.parse(String) on OpenJDK 11.0.8 it yields an NPE directly on the signature without any further stacktrace. 

      We first noticed this on a couple internal Jenkins agents that suddenly were displaying a intermittent failure of a category of tests, troubleshooting narrowed it down to a single worker that was running a separate jdk. Using other agents solved the problem. 

      How to Reproduce

      Use Java OpenJDK 11.0.8 and run a main or a test-method with the mongodb-java-driver 3.8.2 on the classpath. Use  

      @Test
      public void simpleTest() {
         String json = "{ \"_id\" : \"0\" }";
         BasicDBObject.parse(json);
      }

      Results in: 

      This is output when ran from maven. 
      16:01:14 [ERROR] Errors: 16:01:14 [ERROR] MongoDBTest.simpleTest:19 » NullPointer

      Resolved by:

      We resolved this problem by updating to the latest and greatest, but it worked already with the next patch-bump to OpenJDK 11.0.9.

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            mikael.ostberg@avanza.se Mikael Östberg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: