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

Prevent ClassCastException if null is read from MongoDB

    XMLWordPrintable

    Details

    • Tags:
    • Backlog priority:
      800
    • Sprint:
      nxFG 9.1.1, nxFG 9.1.2
    • Story Points:
      3

      Description

      When a null value is stored in MongoDB, it will raise an exception when reading the corresponding metadata:

      ERROR [Nuxeo-Work-173] [org.nuxeo.ecm.core.event.impl.EventServiceImpl] Exception during checkListener sync listener execution, other listeners will be ignored
      java.lang.ClassCastException: [Lcom.mongodb.BasicDBObject; cannot be cast to java.util.List
      	at org.nuxeo.ecm.core.storage.dbs.DBSDocument.getChildAsList(DBSDocument.java:399)
      	at org.nuxeo.ecm.core.storage.dbs.DBSDocument.getChildAsList(DBSDocument.java:80)
      	at org.nuxeo.ecm.core.storage.BaseDocument.readComplexProperty(BaseDocument.java:674)
      	at org.nuxeo.ecm.core.storage.dbs.DBSDocument.readDocumentPart(DBSDocument.java:837)
      	at org.nuxeo.ecm.core.api.DocumentModelFactory.createDataModel(DocumentModelFactory.java:201)
      	at org.nuxeo.ecm.core.api.AbstractSession.getDataModel(AbstractSession.java:1982)
      

      The above stacktrace corresponds to the case when the first value of a list is null.
      As we don't understand yet how the null value was stored, we could provide a workaround not to raise a ClassCastException when retrieving the value from MongoDB.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 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 - 4 hours
                  4h