Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-30964

Fix WARN in RenditionJsonEnricher

    XMLWordPrintable

    Details

      Description

      When trying to create a new document from Web UI, we can see in the logs the following warn:

      2022-04-05T09:58:45,159 WARN  [AbstractJsonEnricher] The following error occured with enricher: renditions
      java.lang.NullPointerException: null
      	at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.checkUnrestricted(UnrestrictedSessionRunner.java:100) ~[nuxeo-core-api-2021.18-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.<init>(UnrestrictedSessionRunner.java:55) ~[nuxeo-core-api-2021.18-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.platform.rendition.service.RenditionFinder.<init>(RenditionFinder.java:66) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
      	at org.nuxeo.ecm.platform.rendition.service.DefaultStoredRenditionManager.findStoredRendition(DefaultStoredRenditionManager.java:45) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
      	at org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl.getRendition(RenditionServiceImpl.java:330) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
      	at org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl.getRendition(RenditionServiceImpl.java:307) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
      	at org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl.getAvailableRenditions(RenditionServiceImpl.java:396) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
      	at org.nuxeo.ecm.platform.rendition.io.RenditionJsonEnricher.write(RenditionJsonEnricher.java:55) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
      	at org.nuxeo.ecm.platform.rendition.io.RenditionJsonEnricher.write(RenditionJsonEnricher.java:41) ~[nuxeo-platform-rendition-core-2021.17.8.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher.write(AbstractJsonEnricher.java:70) [nuxeo-core-io-2021.17.8.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher.write(AbstractJsonEnricher.java:46) [nuxeo-core-io-2021.17.8.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81) [nuxeo-core-io-2021.17.8.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter.write(ExtensibleEntityJsonWriter.java:106) [nuxeo-core-io-2021.17.8.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81) [nuxeo-core-io-2021.17.8.jar:?]
      	at org.nuxeo.ecm.webengine.jaxrs.coreiodelegate.PartialCoreIODelegate.writeTo(PartialCoreIODelegate.java:113) [nuxeo-webengine-jaxrs-2021.17.8
      ...
      

      This commit was intended to fix the issue but

       List<Rendition> renditions = renditionService.getAvailableRenditions(document, true);
      

      should be done after checking the document exists

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: