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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Resolution: Gone away
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Documentation
    • Environment:

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: