Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 74785 invoked from network); 12 May 2008 12:36:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 May 2008 12:36:18 -0000 Received: (qmail 80396 invoked by uid 500); 12 May 2008 12:36:18 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 80364 invoked by uid 500); 12 May 2008 12:36:18 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 80353 invoked by uid 99); 12 May 2008 12:36:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2008 05:36:18 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2008 12:35:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B2B9B234C111 for ; Mon, 12 May 2008 05:35:55 -0700 (PDT) Message-ID: <491759317.1210595755730.JavaMail.jira@brutus> Date: Mon, 12 May 2008 05:35:55 -0700 (PDT) From: "Roman Puchkovskiy (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Created: (JCR-1597) JCARepositoryHandle.login(...) methods never throw NoSuchWorkspaceException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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.