From users-return-15748-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Thu Aug 05 23:03:44 2010 Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 22857 invoked from network); 5 Aug 2010 23:03:43 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Aug 2010 23:03:43 -0000 Received: (qmail 93242 invoked by uid 500); 5 Aug 2010 23:03:43 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 93230 invoked by uid 500); 5 Aug 2010 23:03:42 -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 93221 invoked by uid 99); 5 Aug 2010 23:03:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 23:03:42 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [150.101.137.141] (HELO ipmail04.adl6.internode.on.net) (150.101.137.141) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 23:03:34 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApIFACPeWkx20WY3/2dsb2JhbACGCY1NjGxyxxaCGHMBgi4EiSw Received: from ppp118-209-102-55.lns20.mel4.internode.on.net (HELO crater.homelinux.net) ([118.209.102.55]) by ipmail04.adl6.internode.on.net with ESMTP; 06 Aug 2010 08:33:09 +0930 Received: from comet-wifi.chaos.lan.au (ppp118-209-102-55.lns20.mel4.internode.on.net [118.209.102.55]) by crater.homelinux.net (Postfix) with ESMTPSA id 7C62F6E976B for ; Fri, 6 Aug 2010 09:03:07 +1000 (EST) From: Cory Prowse Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: multipart/alternative; boundary=Apple-Mail-8--53007291 Subject: Re: createWorkspace throws PathNotFoundException Date: Fri, 6 Aug 2010 09:03:06 +1000 In-Reply-To: To: users@jackrabbit.apache.org References: <0A9D498F-8F0A-47C4-B0E4-B6B943B8AA7A@prowse.com> Message-Id: <149CDCC6-8325-4546-B031-603F4DD3222A@prowse.com> X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-8--53007291 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Attempting to use a fresh session still causes the exception. I've created issue JCR-2701: https://issues.apache.org/jira/browse/JCR-2701 Key: JCR-2701 Type: Bug Status: Open Priority: Major Assignee: Unassigned Component/s: jackrabbit-core Affects Version/s: 2.1.0 Fix Version/s: None Environment: Jackrabbit is deployed using released JCA on Glassfish = 3.0.1 -- Cory On 06/08/2010, at 2:19 AM, Alexander Klimetschek wrote: > On Thu, Aug 5, 2010 at 13:57, Cory Prowse wrote: >> Sorry, I should have given a full example of the problem code. >> The following code fails on a fresh setup. >>=20 >> @Startup >> @Singleton >> public class JcrStartupSingleton { >>=20 >> @Resource(name =3D "jcr/repository", type =3D = javax.jcr.Repository.class) >> private Repository repository; >>=20 >> @PostConstruct >> public void setupWorkspaces() throws RepositoryException { >> final Session session =3D repository.login(new = SimpleCredentials("admin1", "".toCharArray()), "production"); >> try { >> session.getRootNode().addNode("example"); >> session.save(); >>=20 >> session.getWorkspace().createWorkspace("staging", = "production"); >> } finally { >> session.logout(); >> } >> } >> } >>=20 >> Gives an exception with a root cause of: >> Caused by: javax.jcr.PathNotFoundException: /example >> at = org.apache.jackrabbit.core.BatchedItemOperations.getNodeState(BatchedItemO= perations.java:1456) >> at = org.apache.jackrabbit.core.BatchedItemOperations.copy(BatchedItemOperation= s.java:387) >> at = org.apache.jackrabbit.core.WorkspaceImpl.internalCopy(WorkspaceImpl.java:4= 04) >> at = org.apache.jackrabbit.core.WorkspaceImpl.clone(WorkspaceImpl.java:606) >> at = org.apache.jackrabbit.core.WorkspaceImpl.createWorkspace(WorkspaceImpl.jav= a:221) >> at = au.projectx.jcr.JcrStartupSingleton.setupWorkspaces(JcrStartupSingleton.ja= va:49) >>=20 >> Where line 49 is: >> session.getWorkspace().createWorkspace("staging", "production"); >=20 > Hmm, looks like a bug. Could you report it on Jira? See > http://jackrabbit.apache.org/issue-tracker.html >=20 > As a workaround, it might work if you use a freshly created session > for the createWorkspace() method: >=20 > Session session =3D repository.login(...); > session.getWorkspace().createWorkspace("staging", "production"); >=20 > Regards, > Alex >=20 > --=20 > Alexander Klimetschek > alexander.klimetschek@day.com --Apple-Mail-8--53007291--