Error when creating workspace

3 messages Options
Embed this post
Permalink
Rakesh Vidyadharan

Error when creating workspace

Reply Threaded More More options
Print post
Permalink
I have seen this issue before related to cloning a workspace through  
the clone method, and wondered if the same issues exist for the create  
method as well (JR 1.6).

   public void create( final String site ) throws RepositoryException
   {
     final Session session = getSessionManager().getSession
( Applications.Admin );
     ( (WorkspaceImpl) session.getWorkspace() ).createWorkspace(
         site, session.getWorkspace().getName() );
   }

I am trying to create a new workspace that clones everything in the  
default workspace.  This method leads to the following exception:

Testcase: com.sptci.cms.util.CreateSiteTest took 0 sec
        Caused an ERROR
no ancestor at degree 1: {}
javax.jcr.PathNotFoundException: no ancestor at degree 1: {}
        at org.apache.jackrabbit.spi.commons.name.PathFactoryImpl
$PathImpl.getAncestor(PathFactoryImpl.java:452)
        at org.apache.jackrabbit.core.BatchedItemOperations.copy
(BatchedItemOperations.java:388)
        at org.apache.jackrabbit.core.WorkspaceImpl.internalCopy
(WorkspaceImpl.java:444)
        at org.apache.jackrabbit.core.WorkspaceImpl.clone(WorkspaceImpl.java:
646)
        at org.apache.jackrabbit.core.WorkspaceImpl.createWorkspace
(WorkspaceImpl.java:252)
        at com.sptci.cms.util.CreateSite.create(CreateSite.java:50)
        at com.sptci.cms.util.CreateSiteTest.init(CreateSiteTest.java:43)

Is this something I have to wait for JR 2.0 to be able to user?

Thanks
Rakesh
Guo Du

Re: Error when creating workspace

Reply Threaded More More options
Print post
Permalink
On Fri, Nov 6, 2009 at 1:56 PM, Rakesh Vidyadharan <[hidden email]> wrote:
> Is this something I have to wait for JR 2.0 to be able to user?
I just did session.getWorkspace().createWorkspace(site,
session.getWorkspace().getName() ) on 2.0-alpha12 and it works.

--Guo
Rakesh Vidyadharan

Re: Error when creating workspace

Reply Threaded More More options
Print post
Permalink

On 6 Nov 2009, at 8:11:30 AM, Guo Du wrote:

> On Fri, Nov 6, 2009 at 1:56 PM, Rakesh Vidyadharan  
> <[hidden email]> wrote:
>> Is this something I have to wait for JR 2.0 to be able to user?
> I just did session.getWorkspace().createWorkspace(site,
> session.getWorkspace().getName() ) on 2.0-alpha12 and it works.
>
> --Guo

Thanks.  I upgraded to the recently released 2.0-beta1 and my tests  
run fine.

Rakesh