You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (Updated) (JIRA)" <ji...@apache.org> on 2011/11/16 18:03:52 UTC

[jira] [Updated] (JCR-2920) Workspace.copy(src, dest) throws unexpected RepositoryException ("Invalid path")

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

Jukka Zitting updated JCR-2920:
-------------------------------

    Fix Version/s: 2.2.10

Merged to the 2.2 branch in revision 1202765.
                
> 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.2.10, 2.3
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira