You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Roman Puchkovskiy (JIRA)" <ji...@apache.org> on 2008/05/12 14:35:55 UTC

[jira] Created: (JCR-1597) JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException

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

                 Key: JCR-1597
                 URL: https://issues.apache.org/jira/browse/JCR-1597
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-jca
    Affects Versions: 1.4
            Reporter: Roman Puchkovskiy


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().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-1597) JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Köll resolved JCR-1597.
-----------------------------

    Resolution: Fixed

I have prefered to check it in the JCARepositoryHandle to be backward compatible with ResourceException
Commited in Rev 779040

> JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException
> ---------------------------------------------------------------------------
>
>                 Key: JCR-1597
>                 URL: https://issues.apache.org/jira/browse/JCR-1597
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jca
>    Affects Versions: 1.4
>            Reporter: Roman Puchkovskiy
>            Assignee: Claus Köll
>             Fix For: 1.6.0
>
>         Attachments: JCR-1597.patch
>
>
> 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().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1597) JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12725646#action_12725646 ] 

Jukka Zitting commented on JCR-1597:
------------------------------------

Merged to the 1.x branch in  revision 789706.

> JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException
> ---------------------------------------------------------------------------
>
>                 Key: JCR-1597
>                 URL: https://issues.apache.org/jira/browse/JCR-1597
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jca
>    Affects Versions: 1.4
>            Reporter: Roman Puchkovskiy
>            Assignee: Claus Köll
>             Fix For: 1.6.0
>
>         Attachments: JCR-1597.patch
>
>
> 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().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (JCR-1597) JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Köll reassigned JCR-1597:
-------------------------------

    Assignee: Claus Köll

> JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException
> ---------------------------------------------------------------------------
>
>                 Key: JCR-1597
>                 URL: https://issues.apache.org/jira/browse/JCR-1597
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jca
>    Affects Versions: 1.4
>            Reporter: Roman Puchkovskiy
>            Assignee: Claus Köll
>             Fix For: 1.6.0
>
>         Attachments: JCR-1597.patch
>
>
> 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().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1597) JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException

Posted by "Roman Puchkovskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Puchkovskiy updated JCR-1597:
-----------------------------------

    Attachment: JCR-1597.patch

Attaching proposed patch. This just uses ResourceException(String, Throwable) constructor. Not sure, is this correct, please review.

> JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException
> ---------------------------------------------------------------------------
>
>                 Key: JCR-1597
>                 URL: https://issues.apache.org/jira/browse/JCR-1597
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-jca
>    Affects Versions: 1.4
>            Reporter: Roman Puchkovskiy
>         Attachments: JCR-1597.patch
>
>
> 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().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1597) JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Köll updated JCR-1597:
----------------------------

    Fix Version/s: 1.6.0

> JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException
> ---------------------------------------------------------------------------
>
>                 Key: JCR-1597
>                 URL: https://issues.apache.org/jira/browse/JCR-1597
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jca
>    Affects Versions: 1.4
>            Reporter: Roman Puchkovskiy
>            Assignee: Claus Köll
>             Fix For: 1.6.0
>
>         Attachments: JCR-1597.patch
>
>
> 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().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.