Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-6295

StackOverflowException when Jackson tries to serialize a Resource object

    XMLWordPrintableJSON

Details

    Description

      When a model class has a property of type Resource (or a collection of Resource objects), attempting to serialize that class into a String produces a StackOverflow due to the getParent() method.

      The simplest solution would be to use Jackson mixins to skip the getParent() (and, for good measure, the getResourceResolver() and getResourceMetadata()) methods. A better solution would be to simply use the standard Sling JSON in these cases.

      Attachments

        Activity

          People

            justinedelson Justin Edelson
            justinedelson Justin Edelson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: