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

Rhino NativeDate not serialized properly

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.11.3
    • Component/s: Codecs
    • Labels:
      None
    • Environment:
      rhino 1.7R5

      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.

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

              Created:
              Updated:
              Resolved: