Hi,
I am trying to move pages from one place to another place using seesion. But I am getting javax.jcr.ItemExistsException: Same name siblings are not allowed.
Below is my code:
String sourcePath = "/content/a/b1";
String destinationPath = "/content/a/b2";
session.move(sourcePath, destinationPath);
session.save();
Solved! Go to Solution.
Move items in the JCR using the AssetManager API:
https://helpx.adobe.com/experience-manager/using/graniteAPI.html
In this example - we are moving nodes that represent PDF. But it will work for other nodes.
Views
Replies
Total Likes
Hi,
apologies if I am stating the obvious and you have already checked. But could it be possible that you ran the code once and it was successful, but on subsequent runs you got an exception because the new node had already been created?
Please go to the new target path and delete the new node, "/content/a/b2", and run you code again.
Regards,
Opkar
Views
Replies
Total Likes
Views
Replies
Total Likes
Move items in the JCR using the AssetManager API:
https://helpx.adobe.com/experience-manager/using/graniteAPI.html
In this example - we are moving nodes that represent PDF. But it will work for other nodes.
edubey wrote...
An ItemExistsException is thrown if a property already exists at destination path or a node already exists there and same-name siblings are not allowed.
It doesn't have any common property. What is meant by same name siblings ?
Views
Replies
Total Likes
Using assetManager its working fine.
But while using Session source and destination paths should be as below :
String sourcePath = "/content/a/b1";
String destinationPath = "/content/a/b2/b1";
to move b1 under b2 node you should mention b1 node under b2 in destination path.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies