Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 57329 invoked from network); 28 Mar 2006 17:18:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Mar 2006 17:18:46 -0000 Received: (qmail 14852 invoked by uid 500); 28 Mar 2006 17:18:45 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 14612 invoked by uid 500); 28 Mar 2006 17:18:44 -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 14603 invoked by uid 99); 28 Mar 2006 17:18:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Mar 2006 09:18:44 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Mar 2006 09:18:43 -0800 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id AEB836ACAA for ; Tue, 28 Mar 2006 18:18:22 +0100 (BST) Message-ID: <1239671920.1143566302713.JavaMail.jira@ajax> Date: Tue, 28 Mar 2006 18:18:22 +0100 (BST) From: "Jukka Zitting (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-328) TransientRepository with LocalFileSystem eventually causes Repository data to be stored at path '/' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/JCR-328?page=comments#action_12372123 ] Jukka Zitting commented on JCR-328: ----------------------------------- Merged to 1.0 in revision 389548. > TransientRepository with LocalFileSystem eventually causes Repository data to be stored at path '/' > --------------------------------------------------------------------------------------------------- > > Key: JCR-328 > URL: http://issues.apache.org/jira/browse/JCR-328 > Project: Jackrabbit > Type: Bug > Components: core > Versions: 0.9 > Reporter: Mark Slater > Assignee: Jukka Zitting > Fix For: 1.0 > > I'm using a TransitoryRepository for my unit testing, with the repository's file system specified as: > > > > I noticed today that when I run my unit tests Jackrabbit is creating four directories at the root of my hard drive: "meta", "namespaces", "nodetypes", and "data". I tracked the problem the fact that when a LocalFileSystem is closed, it sets the "root" to null - an invalid state. But when using a TransitoryRepository, the invalid state is never discovered because the LocalFileSystem object itself is not released, or re-initialized. It is simply used to create BasedFileSystem objects in RepositoryImpl. Calls to BasedFileSystem defer to the LocalFileSystem object that now has a null root. Inside the LocalFileSystem, all the calls to Java's io.File constructor have a "null" parent parameter, causing File to fall back to its single argument constructor which sees the path "/meta" and happily creates files at the root of the disk. > I'm not sure what the best solution is, but some thoughts I've had are: > - don't set the "root" property to null when closing a LocalFileSystem > - make RepositoryConfig re-init the FileSystem variable when it is accessed. > - don't cache the RepositoryConfig in TransitoryRepository (this might also require a new constructor that takes a class-path resource for the repository configuration file) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira