Uploaded image for project: '[Read Only] - Hippo Repository'
  1. [Read Only] - Hippo Repository
  2. REPO-2082

Possible ClassCastException because JR VersionManagerImpl casts to VersionImpl

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.6.0
    • Component/s: None
    • Labels:
      None
    • Similar issues:
    • Processed by team:
      Turing
    • Sprint:
      Turing Team 187

      Description

      Turns out that

      workflowSession.getWorkspace().getVersionManager().restore(version, false);
      

      can result in the following problem:

      ^[[19~[INFO] [talledLocalContainer] 18.07.2018 17:03:52 INFO  http-nio-8080-exec-4 [StdWorkflow.invoke:225] Workflow call failed
      [INFO] [talledLocalContainer] java.lang.ClassCastException: org.hippoecm.repository.impl.VersionDecorator cannot be cast to org.apache.jackrabbit.core.version.VersionImpl
      [INFO] [talledLocalContainer] 	at org.apache.jackrabbit.core.VersionManagerImpl$6.perform(VersionManagerImpl.java:239) ~[jackrabbit-core-2.16.2-h1.jar:2.16.2-h1]
      [INFO] [talledLocalContainer] 	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216) ~[jackrabbit-core-2.16.2-h1.jar:2.16.2-h1]
      [INFO] [talledLocalContainer] 	at org.apache.jackrabbit.core.VersionManagerImpl.perform(VersionManagerImpl.java:96) ~[jackrabbit-core-2.16.2-h1.jar:2.16.2-h1]
      [INFO] [talledLocalContainer] 	at org.apache.jackrabbit.core.VersionManagerImpl.restore(VersionManagerImpl.java:225) ~[jackrabbit-core-2.16.2-h1.jar:2.16.2-h1]
      [INFO] [talledLocalContainer] 	at org.apache.jackrabbit.core.VersionManagerImpl.restore(VersionManagerImpl.java:217) ~[jackrabbit-core-2.16.2-h1.jar:2.16.2-h1]
      [INFO] [talledLocalContainer] 	at org.hippoecm.repository.impl.VersionManagerDecorator.restore(VersionManagerDecorator.java:120) ~[hippo-repository-engine-5.5.0-campaigns-psp1-SNAPSHOT.jar:5.5.0-campaigns-psp1-SNAPSHOT]
      [INFO] [talledLocalContainer] 	at org.onehippo.repository.documentworkflow.task.RestoreVersionToBranchTask.doExecute(RestoreVersionToBranchTask.java:67) ~[hippo-repository-workflow-5.5.0-campaigns-psp1-SNAPSHOT.jar:5.5.0-campaigns-psp1-SNAPSHOT]
      [INFO] [talledLocalContainer] 	at org.onehippo.repository.documentworkflow.task.AbstractDocumentTask.execute(AbstractDocumentTask.java:93) ~[hippo-repository-workflow-5.5.0-campaigns-psp1-SNAPSHOT.jar:5.5.0-campaigns-psp1-SNAPSHOT]
      

      instead of trying to fix the decorator root cause the following does work:

      workflowSession.getWorkspace().getVersionManager().restore(targetNode.getPath(), version.getName(), false);
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                aschrijvers Ard Schrijvers
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: