jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: createWorkspace throws PathNotFoundException
Date Thu, 05 Aug 2010 11:29:09 GMT
On Thu, Aug 5, 2010 at 10:41, Cory Prowse <cory@prowse.com> wrote:
> Hi,
>
> I'm attempting to create a workspace from another srcWorkspace but it is throwing a PathNotFoundException
on a node that is a child of the root.
>
> This is on JackRabbit 2.1.0 deployed as a JCA.
>
> I am essentially doing the following:
>
> session = repository.login(new SimpleCredentials("admin1", "".toCharArray()), "default");
> session.getRootNode().addNode("/example", NodeType.NT_UNSTRUCTURED);
> session.save();
> workspace.createWorkspace("staging", "default");
> session.logout();
>
> This throws a PathNotFoundException on "/example".
>
> Not sure what to do from here, can anyone provide possible causes?

I guess if you look close, the exception is not thrown by
createWorkspace but by the previous addNode() (or save()) operation.
addNode() expects a relative path, so it should be:

session.getRootNode().addNode("example", NodeType.NT_UNSTRUCTURED);

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message