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

Rhino NativeDate not serialized properly

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • 2.11.3
    • Codecs
    • None
    • rhino 1.7R5

    Description

      For this object (note "when" field):

      var o = {
          "_id" : id,
          "when" : new Date(),
          "name"  : "MongoDB" + 'def',
          "type"  : "database",
          "count" : 1,
          "info"  : {
              x : 203,
              y : 102
          }
      };

      This call:

      new BasicDBObject(o);

      Throws the following error:

      org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: can't serialize class org.mozilla.javascript.NativeDate 

      There was a similar issue with ConsString that was fixed in the latest driver build. The "name" field above should cause the ConsString instance to be passed to the function, which works. It did not in previous version of the driver.

      A fix for this would be awesome.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mykesx Michael Schwartz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: