Spring Data MongoDB
  1. Spring Data MongoDB
  2. DATAMONGO-86

Bug in deserialisation of Entitys with Embedded Collections

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 1.0 M2
    • Fix Version/s: 1.0 M2
    • Component/s: Mapping
    • Labels:
      None
    • Environment:
      MongoDB 1.8.1, Ubuntu 10.04, spring-data-mongodb-BUILD-SNAPSHOT

      Description

      1. Create a class with containing a List of Objects.
      2. Store it to the database
      3. Load it from the database
      4. try to add another element to the list

      -> java.lang.UnsupportedOperationException

      • the implementation of the List is a java.util.Arrays.ArrayList (inner class of Arrays)
      • this list inherits from AbstractList and only overrides some Methods
      • the other Methods are stubbed and throw an UnsupportedOperationException
      • probably Arrays.asList() has been used to convert the JSon array to a List.
      • solution: do not use Arrays.asList()

        Activity

        Hide
        Thomas Risberg added a comment -

        Which converter are you using? The default SimpleMongoConverter? Can you post a test case that shows this issue?

        Thanks,
        Thomas

        Show
        Thomas Risberg added a comment - Which converter are you using? The default SimpleMongoConverter? Can you post a test case that shows this issue? Thanks, Thomas
        Hide
        Matthias Scudlik added a comment -

        I use the default converter.

        You can find a small test projekt showing this (and other) bug(s)

        http://ethone.de/spring/mongodb-samples.zip

        Show
        Matthias Scudlik added a comment - I use the default converter. You can find a small test projekt showing this (and other) bug(s) http://ethone.de/spring/mongodb-samples.zip
        Hide
        Mark Pollack added a comment -

        Thanks. Make a fix and the test case passes. We will spend time expanding the coverage of our tests for the next (post M2) release. .

        Show
        Mark Pollack added a comment - Thanks. Make a fix and the test case passes. We will spend time expanding the coverage of our tests for the next (post M2) release. .

          People

          • Assignee:
            Mark Pollack
            Reporter:
            Matthias Scudlik
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: