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

Fix ClassCastException when running orphanVersionsCleanup with sequence ids

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.10
    • Fix Version/s: 10.10-HF58, 2021.15
    • Component/s: Core, Core VCS
    • Backlog priority:
      700
    • Sprint:
      nxplatform #52, nxplatform #53
    • Story Points:
      0

      Description

      After setting nuxeo.vcs.idtype=sequence and using PostgreSQL, the orphanVersionsCleanup will fail with this exception

      2021-09-26T01:30:01,090 ERROR [Nuxeo-Work-default-4:142921012181100.1066606981] [org.nuxeo.ecm.core.event.impl.AsyncEventExecutor] Failed to execute async event null on listener orphanVersionsCleanup
      2021-09-26T01:30:01,090 ERROR [Nuxeo-Work-default-4:142921012181100.1066606981] [org.nuxeo.ecm.core.event.impl.AsyncEventExecutor] Failed to execute async event null on listener orphanVersionsCleanup
      java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
       at org.nuxeo.ecm.core.CoreService.doCleanupOrphanVersions(CoreService.java:180) ~[nuxeo-core-10.10.jar:?]
       at org.nuxeo.ecm.core.CoreService.lambda$null$0(CoreService.java:166) ~[nuxeo-core-10.10.jar:?]
       at org.nuxeo.ecm.core.api.CoreInstance$3.run(CoreInstance.java:223) ~[nuxeo-core-api-10.10.jar:?]
       at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.runUnrestricted(UnrestrictedSessionRunner.java:131) ~[nuxeo-core-api-10.10.jar:?]
       at org.nuxeo.ecm.core.api.CoreInstance.doPrivileged(CoreInstance.java:225) ~[nuxeo-core-api-10.10.jar:?]
       at org.nuxeo.ecm.core.CoreService.lambda$cleanupOrphanVersions$1(CoreService.java:165) ~[nuxeo-core-10.10.jar:?]
       at org.nuxeo.runtime.transaction.TransactionHelper.lambda$runInTransaction$3(TransactionHelper.java:569) ~[nuxeo-runtime-jtajca-10.10.jar:?]
       at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:589) ~[nuxeo-runtime-jtajca-10.10.jar:?]
       at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:569) ~[nuxeo-runtime-jtajca-10.10.jar:?]
       at org.nuxeo.ecm.core.CoreService.cleanupOrphanVersions(CoreService.java:164) ~[nuxeo-core-10.10.jar:?]
       at org.nuxeo.ecm.core.versioning.OrphanVersionCleanupListener.handleEvent(OrphanVersionCleanupListener.java:73) ~[nuxeo-core-10.10.jar:?]
       

      the ClassCastException happens on

                      String versionSeriesId = (String) map.get(NXQL.ECM_VERSION_VERSIONABLEID);
      

      https://github.com/nuxeo/nuxeo/blob/release-10.10/nuxeo-core/nuxeo-core/src/main/java/org/nuxeo/ecm/core/CoreService.java#L180

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: