Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 79202 invoked from network); 22 Jul 2009 05:45:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jul 2009 05:45:20 -0000 Received: (qmail 26622 invoked by uid 500); 22 Jul 2009 05:46:24 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 26588 invoked by uid 500); 22 Jul 2009 05:46:24 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 26577 invoked by uid 99); 22 Jul 2009 05:46:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jul 2009 05:46:24 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [68.180.197.186] (HELO web45316.mail.sp1.yahoo.com) (68.180.197.186) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 22 Jul 2009 05:46:15 +0000 Received: (qmail 29944 invoked by uid 60001); 22 Jul 2009 05:45:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1248241554; bh=VqHL8+YEYWRBRreay5B+Ir+D3r8D8ytArX9TjcahIEQ=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=TtovLreh9Ugd34+uyKqg/JBUE+AzIHrdgf1IXnY3WM4ddxJwh4ft5zojbuh7d91ETGrd4fqouiSHg+1HxK5s1vgOeWqfaE6ZBnDanmF0dl0zTPp8NZ8H9ZnPAX0Q+FXFNMewcK8in4i2FQ1C23BYMeYCVZd9u40X3i66qJ14liY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=4jEQPwIrSDTVZXpbcoBXGk14WPvskr9KvckHFYrRQVOv+9VHAPCCrb8NOMzEmfTajiagY0QnZzkZ0Q5veC/AMoghTrgFJtM6RHyzVxQLB9Sj/1PaBGqxewJvG0mqwoPqxOxJIZoHsTgSsP7aGytpbtiHRQ9dWo5rAkWUjZfvsXM=; Message-ID: <377998.29182.qm@web45316.mail.sp1.yahoo.com> X-YMail-OSG: mdiPAkMVM1kO0dpTI1rVJCv44UK.P3.SwpSrzk55BlIWf1f5WDKGPImInwPrIBRCcAQcHbxIG1B1r1HwQ2vVzAvooGfIn1XQPhPhEvEiH2HknMaoVxS3K229uYxBxRo3mWI03g4miw3Q6CtSQk5w2R0Fe.wzRIzScRHEgOrYAF_QngX.GrXcOElYKFrN59b.XrBn5kzEXA2c.BcRISMRiiZCL4ZpLzk1aROFq3dfFHVHI2ODcIzuuO1omMv7rA3.t3ISrgm9b1zHsjoRoiJHCbpGgoGwR1koJnDVZo4jp7DhjGMPHvxvDlZhiS_cf_mnDgts7w7_xuGqPH6EFff1 Received: from [15.211.153.71] by web45316.mail.sp1.yahoo.com via HTTP; Tue, 21 Jul 2009 22:45:54 PDT X-Mailer: YahooMailRC/1358.22 YahooMailWebService/0.7.289.15 References: <631574.66431.qm@web45315.mail.sp1.yahoo.com> <855751.64927.qm@web45305.mail.sp1.yahoo.com> Date: Tue, 21 Jul 2009 22:45:54 -0700 (PDT) From: go canal Subject: Re: PathNotFoundException To: users@jackrabbit.apache.org In-Reply-To: <855751.64927.qm@web45305.mail.sp1.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-14848920-1248241554=:29182" X-Virus-Checked: Checked by ClamAV on apache.org --0-14848920-1248241554=:29182 Content-Type: text/plain; charset=us-ascii Did I misunderstand some basic concept ? this is how I create a new root node: parentNode = getSession().getRootNode(); Node newNode = jcrom.addNode(parentNode, entity, mixinTypes); the entity has a path set to "/documents", immediately, I check the availability: return getSession().getRootNode().hasNode ("documents"); and it says path not found ... rgds, canal ________________________________ From: go canal To: users@jackrabbit.apache.org Sent: Wednesday, July 22, 2009 8:13:31 AM Subject: Re: PathNotFoundException I quickly use exists("/documents") to check, strange though, it says, not existing ! I traced and found that internally exists() function added the root, which I have set to "/documents" so the fullpath becomes "/documents/documents" but then I tried to check exisits(""), also does not find .... this time the path becomes "/documents/", and the relative path is "documents/" >> how should I check my new root ? I use AbstractJcrDAO.create ("/", node) to create the root, the node has: path = "/documents" name = "documents" This is the actual method in AbsractJcrDAO: public T create(String parentNodePath, T entity) { try { String entityName = jcrom.getName(entity); if ( entityName == null || entityName.equals("") ) { throw new JcrMappingException("The name of the entity being created is empty!"); } if ( parentNodePath == null || parentNodePath.equals("") ) { throw new JcrMappingException("The parent path of the entity being created is empty!"); } Node parentNode; if ( parentNodePath.equals("/") ) { // special case, add directly to the root node parentNode = getSession().getRootNode(); <<<<<<---- traced here, got root successfully } else { parentNode = getSession().getRootNode().getNode(relativePath(parentNodePath)); } Node newNode = jcrom.addNode(parentNode, entity, mixinTypes); <<<<<---traced here, also no issue getSession().save(); if ( isVersionable ) { //newNode.checkin(); checkinRecursively(newNode); } //return (T)jcrom.fromNode(entityClass, newNode); return entity; <<<<<<<-----return successfully } catch ( RepositoryException e ) { throw new JcrMappingException("Could not create node", e); } } rgds, canal ________________________________ From: go canal To: users@jackrabbit.apache.org Sent: Wednesday, July 22, 2009 7:58:48 AM Subject: PathNotFoundException hi, have been struggling with this for quite sometime already....help needed I first created /documents root node, then I wanted to add a new file node to it.. I am using jcrom - sorry if this is not the right forum but hoping some people here use it also ....... /documents is created successfully, but when adding the new node, I got PathNotFoundException in AbstractJcrDAO: public T create(String parentNodePath, T entity) { ..... parentNode = getSession().getRootNode().getNode(relativePath(parentNodePath)); .... } I traced the parentNodePath, which is the correct 'documents'. Why it throws 'PathNotFound' ? I lost .... rgds, canal --0-14848920-1248241554=:29182--