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

Mongo java driver insertOne() NullPointerException

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.0
    • Component/s: API
    • None
    • Environment:
      CentOS 6.5 64bits (Installed on vSphere virtual machine)
    • Major Change

      when use mongo java driver(3.0.0rc1) to insert doc into mongodb (3.0.0 ) which was installed on a virtual server built by VMware vSphere,the API insertOne() could not work. The call stack shown as below:
      Caused by: java.lang.NullPointerException
      at com.mongodb.connection.ProtocolHelper.isCommandOk(ProtocolHelper.java:61)
      at com.mongodb.connection.WriteCommandProtocol.receiveMessage(WriteCommandProtocol.java:189)
      at com.mongodb.connection.WriteCommandProtocol.execute(.java:76)
      at com.mongodb.connection.InsertCommandProtocol.execute(InsertCommandProtocol.java:66)
      at com.mongodb.connection.InsertCommandProtocol.execute(InsertCommandProtocol.java:37)
      at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:155)
      at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:219)
      at com.mongodb.connection.DefaultServerConnection.insertCommand(DefaultServerConnection.java:108)
      at com.mongodb.operation.MixedBulkWriteOperation$Run$2.executeWriteCommandProtocol(MixedBulkWriteOperation.java:416)
      at com.mongodb.operation.MixedBulkWriteOperation$Run$RunExecutor.execute(MixedBulkWriteOperation.java:604)
      at com.mongodb.operation.MixedBulkWriteOperation$Run.execute(MixedBulkWriteOperation.java:363)
      at com.mongodb.operation.MixedBulkWriteOperation$1.call(MixedBulkWriteOperation.java:148)
      at com.mongodb.operation.MixedBulkWriteOperation$1.call(MixedBulkWriteOperation.java:141)
      at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:186)
      at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:177)
      at com.mongodb.operation.MixedBulkWriteOperation.execute(MixedBulkWriteOperation.java:141)
      at com.mongodb.operation.MixedBulkWriteOperation.execute(MixedBulkWriteOperation.java:72)
      at com.mongodb.Mongo.execute(Mongo.java:745)
      at com.mongodb.Mongo$2.execute(Mongo.java:728)
      at com.mongodb.MongoCollectionImpl.executeSingleWriteRequest(MongoCollectionImpl.java:482)
      at com.mongodb.MongoCollectionImpl.insertOne(MongoCollectionImpl.java:277)

      PS: this exception happens not all the time.and never happens on windows

            Assignee:
            Unassigned Unassigned
            Reporter:
            windofthesky windofthesky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: