-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 9.10, 10.10
-
Fix Version/s: 9.10-HF32, 10.10-HF07, 11.1, 2021.0
-
Component/s: Collections
This bug cannot be reproduced with a bare Nuxeo Platform because it requires an instance without a Domain document.
This NPE occurs when the Favorites collection does not exist. How?
The Favorites collection is created in the user personal workspace, which is created in the user workspace root which is created under the first created Domain document.
=> if there is no Domain found by this query, none of the previous document will be created. Hence the NPE when reading collection.getId() on this line.
Here is the corresponding stacktrace on 9.10
ERROR [http-nio-0.0.0.0-8080-exec-15] [org.nuxeo.ecm.platform.web.common.requestcontroller.filter.NuxeoRequestControllerFilter] remote=0:0:0:0:0:0:0:1,principal=xxx,uri=/nuxeo/site/api/v1/path/document,session=D8E8FDC944654263AB62F79CA561DA4B.nuxeo,thread=http-nio-0.0.0.0-8080-exec-15,info=Unhandled error was caught by the Filter java.lang.NullPointerException at org.nuxeo.ecm.collections.core.CollectionManagerImpl.isInCollection(CollectionManagerImpl.java:288) at org.nuxeo.ecm.collections.core.FavoritesManagerImpl.isFavorite(FavoritesManagerImpl.java:108) at org.nuxeo.ecm.collections.core.io.FavoritesJsonEnricher.write(FavoritesJsonEnricher.java:57) at org.nuxeo.ecm.collections.core.io.FavoritesJsonEnricher.write(FavoritesJsonEnricher.java:40) at org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher.write(AbstractJsonEnricher.java:54) at org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher.write(AbstractJsonEnricher.java:37) at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:76) at org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter.write(ExtensibleEntityJsonWriter.java:99) at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:76) at org.nuxeo.ecm.webengine.jaxrs.coreiodelegate.PartialCoreIODelegate.writeTo(PartialCoreIODelegate.java:119)