You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Rakesh Vidyadharan <ra...@sptci.com> on 2009/11/06 14:56:11 UTC

Error when creating workspace

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

Re: Error when creating workspace

Posted by Rakesh Vidyadharan <ra...@sptci.com>.
On 6 Nov 2009, at 8:11:30 AM, Guo Du wrote:

> On Fri, Nov 6, 2009 at 1:56 PM, Rakesh Vidyadharan  
> <ra...@sptci.com> 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

Re: Error when creating workspace

Posted by Guo Du <mr...@gmail.com>.
On Fri, Nov 6, 2009 at 1:56 PM, Rakesh Vidyadharan <ra...@sptci.com> 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