Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-1597

JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4
    • 1.6
    • jackrabbit-jca
    • None

    Description

      Call sequence:
      JCARepositoryHandle.login(Credentials, String) // (here non-existent workspace is specified for login)
      JCARepositoryHandle.login(JCAConnectionRequestInfo)
      ConnectionManager.allocateConnection(ManagedConnectionFactory, ConnectionRequestInfo)
      ...
      JCAManagedConnection.openSession(JCAConnectionRequestInfo)
      Repository.login(Credentials, String) // here NoSuchWorkspaceException is thrown, catched by JCAManagedConnection.openSession(JCAConnectionRequestInfo), set as linkedException to ResourceException, which is thrown
      ...
      Here (in JCARepositoryHandle.login(JCAConnectionRequestInfo)) ResourceException is caught, its cause is retreived, and, if cause is NoSuchWorkspaceException, it's thrown, else another exception is thrown.

      Note, that when exception occures on lower level, it's wrapped in ResourceException using setLinkedException(), but on upper level it's unwrapped using getCause(). But cause is not set by anyone, it's null, so NoSuchWorkspaceException is never thrown here.

      Suggested fix is to use same mechanism on both ends: either change wrapping mechanism to exception chaining (new ResourceException(msg, cause)), or unwrap using ResourceException.getLinkedException().

      Attachments

        1. JCR-1597.patch
          0.7 kB
          Roman Puchkovskiy

        Activity

          People

            c_koell Claus Köll
            rpuch Roman Puchkovskiy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: