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

Fix silent exception when adding a tag to a doc type not supporting tagging

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.3-SNAPSHOT
    • Fix Version/s: 9.3
    • Component/s: Tagging

      Description

      When adding a tag through the org.nuxeo.ecm.platform.tag.operations.TagDocument operation to a doc not supporting tagging. You receive a meaningless 500 error.

      While debugging I figured out the exception

      17:03:26,958 WARN  [ReconnectedEventBundleImpl] Listener 'notificationListener' cannot refetch missing document: 11cefb22-6991-4dc5-8f54-eb19c9dd8937 (/default-domain/Nuxeo_Workspace/Test_Folder)
      java.lang.reflect.InvocationTargetException
      	at sun.reflect.GeneratedMethodAccessor1258.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.nuxeo.ecm.automation.core.impl.InvokableMethod.doInvoke(InvokableMethod.java:173)
      	at org.nuxeo.ecm.automation.core.impl.InvokableMethod.invoke(InvokableMethod.java:178)
      	at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$OperationMethod.invoke(OperationChainCompiler.java:128)
      	at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$CompiledChainImpl.invoke(OperationChainCompiler.java:196)
      	at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:120)
      	at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:107)
      	at org.nuxeo.ecm.automation.server.jaxrs.OperationResource.execute(OperationResource.java:58)
      	at org.nuxeo.ecm.automation.server.jaxrs.ExecutableResource.doPost(ExecutableResource.java:70)
      	...
      Caused by: java.lang.UnsupportedOperationException
      	at java.util.AbstractList.add(AbstractList.java:148)
      	at java.util.AbstractList.add(AbstractList.java:108)
      	at org.nuxeo.ecm.platform.tag.FacetedTagService.doTag(FacetedTagService.java:77)
      	at org.nuxeo.ecm.platform.tag.AbstractTagService.lambda$tag$0(AbstractTagService.java:103)
      	at org.nuxeo.ecm.core.api.CoreInstance$4.run(CoreInstance.java:327)
      	at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.runUnrestricted(UnrestrictedSessionRunner.java:117)
      	at org.nuxeo.ecm.core.api.CoreInstance.doPrivileged(CoreInstance.java:329)
      	at org.nuxeo.ecm.platform.tag.AbstractTagService.tag(AbstractTagService.java:102)
      	at org.nuxeo.ecm.platform.tag.operations.TagDocument.run(TagDocument.java:58)
      	... 139 more
      
      
      

      it is caused by org.nuxeo.ecm.platform.tag.FacetedTagService.getTags(DocumentModel) which catches the PropertyNotFound excpeption and retuning a Collections.emptyList()

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 20 minutes
                  20m