jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (JCR-2920) Workspace.copy(src, dest) throws unexpected RepositoryException ("Invalid path")
Date Thu, 17 Mar 2011 18:30:29 GMT

     [ https://issues.apache.org/jira/browse/JCR-2920?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Stefan Guggisberg resolved JCR-2920.
------------------------------------

    Resolution: Fixed

fixed in trunk (#1082620)

> Workspace.copy(src, dest) throws unexpected RepositoryException ("Invalid path")
> --------------------------------------------------------------------------------
>
>                 Key: JCR-2920
>                 URL: https://issues.apache.org/jira/browse/JCR-2920
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi2dav
>            Reporter: Stefan Guggisberg
>             Fix For: 2.3.0
>
>
> when using the davex remoting layer (jcr2spi->spi2davex), 
> the following code fragment causes an unexpected RepositoryException:
> <snip>
>     Node testNode1 = session.getRootNode().addNode("test", "nt:folder");
>     Node copyDestination = testNode1.addNode("CopyDestination", "nt:folder");
>     testNode1.addNode("CopySource", "nt:folder").addNode("testCopyCommand", "nt:folder").addNode("abc",
"nt:folder");
>     session.save();
>     copyDestination.addMixin("mix:referenceable");
>     session.save();
>     session.getWorkspace().copy("/test/CopySource/testCopyCommand", "/test/CopyDestination/testCopyCommand");
> </snip>
> ==> Caused by: javax.jcr.RepositoryException: Invalid path:/test/CopyDestination//testCopyCommand
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> 	at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:69)
> 	at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
> 	at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.execute(RepositoryServiceImpl.java:482)
> 	at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.copy(RepositoryServiceImpl.java:1307)
> 	at org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.copy(RepositoryServiceImpl.java:326)
> 	at org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.visit(WorkspaceManager.java:889)
> 	at org.apache.jackrabbit.jcr2spi.operation.Copy.accept(Copy.java:48)
> 	at org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.execute(WorkspaceManager.java:848)
> 	at org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.access$400(WorkspaceManager.java:793)
> 	at org.apache.jackrabbit.jcr2spi.WorkspaceManager.execute(WorkspaceManager.java:581)
> 	at org.apache.jackrabbit.jcr2spi.WorkspaceImpl.copy(WorkspaceImpl.java:149)
> 	[...]  
> however, the following slightly altered code fragment works as expected:
> <snip>
>     Node testNode1 = session.getRootNode().addNode("test", "nt:folder");
> /*
>     Node copyDestination = testNode1.addNode("CopyDestination", "nt:folder");
>     testNode1.addNode("CopySource", "nt:folder").addNode("testCopyCommand", "nt:folder").addNode("abc",
"nt:folder");
>     session.save();
>     copyDestination.addMixin("mix:referenceable");
>     session.save();
> */
>     testNode1.addNode("CopyDestination", "nt:folder").addMixin(NodeType.MIX_REFERENCEABLE);
>     Node n = testNode1.addNode("CopySource", "nt:folder").addNode("testCopyCommand",
"nt:folder").addNode("abc", "nt:folder");
>     session.save();
>     session.getWorkspace().copy("/test/CopySource/testCopyCommand", "/test/CopyDestination/testCopyCommand");
> </snip>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message