jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1823) Repository.login throws IllegalStateException
Date Fri, 28 Nov 2008 13:29:44 GMT

    [ https://issues.apache.org/jira/browse/JCR-1823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651561#action_12651561
] 

Jukka Zitting commented on JCR-1823:
------------------------------------

+1

> Repository.login throws IllegalStateException
> ---------------------------------------------
>
>                 Key: JCR-1823
>                 URL: https://issues.apache.org/jira/browse/JCR-1823
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.5
>            Reporter: Felix Meschberger
>
> Calling any login method on Repository instance, which has been shut down throws an IllegalStateException,
which is caused by the RepositoryImpl.sanityCheck method.
> This exception is unexpected by callers of the login method, which is specified to throw
one of LoginException, NoSuchWorkspaceException and RepositoryException. In particular the
spec says, that a RepositoryException is thrown "if another error occurs".
> So I suggest to modify the RepositoryImpl.login(Credentials, String) as follows (patch
against trunk):
> Index: /usr/src/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
> ===================================================================
> --- /usr/src/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
(revision 706543)
> +++ /usr/src/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
(working copy)
> @@ -1358,6 +1358,8 @@
>          } catch (AccessDeniedException ade) {
>              // authenticated subject is not authorized for the specified workspace
>              throw new LoginException("Workspace access denied", ade);
> +        } catch (RuntimeException re) {
> +            throw new RepositoryException(re.getMessage(), re);
>          } finally {
>              shutdownLock.readLock().release();
>          }

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


Mime
View raw message