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

Comment on: "mongodb-ecosystem/tutorial/use-java-dbobject-to-perform-saves.txt"

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • None
    • Affects Version/s: None
    • Component/s: Documentation
    • Environment:

      Hi.

      When I implement Java DBObject to Perform Saves' exemple exactly as described in the tutorial, I get the following exception :

      Exception in thread "main" java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
      Caused by: java.lang.NullPointerException
      at com.mongodb.DBCollection._checkKeys(DBCollection.java:1801)
      at com.mongodb.DBCollection._checkObject(DBCollection.java:1789)
      at com.mongodb.DBCollectionImpl.applyRulesForInsert(DBCollectionImpl.java:392)
      at com.mongodb.DBCollectionImpl.insertWithCommandProtocol(DBCollectionImpl.java:381)
      at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:186)
      at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:165)
      at com.mongodb.DBCollection.insert(DBCollection.java:93)
      at com.mongodb.DBCollection.insert(DBCollection.java:78)
      at com.mongodb.DBCollection.insert(DBCollection.java:120)
      at tweet.Tweet.main(Tweet.java:27)
      ... 5 more

      Could you tell if its a known bug or clarify how to persist a Java object in MongoDB?

      Best regards,

      Lionel Ketterer

      Reporter: Lionel Ketterer
      E-mail: lionel.ketterer@thalesgroup.com

            Assignee:
            Unassigned Unassigned
            Reporter:
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: