Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java =================================================================== --- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java (revision 645007) +++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java (working copy) @@ -253,7 +253,7 @@ int ind = destName.getIndex(); if (ind > 0) { // subscript in name element - String msg = "invalid destination path (subscript in name element is not allowed)"; + String msg = "invalid destination path: " + safeGetJCRPath(destPath) + " (subscript in name element is not allowed)"; log.debug(msg); throw new RepositoryException(msg); } @@ -302,7 +302,7 @@ // 3. verify that source has mixin mix:shareable if (!isShareable(srcState)) { - String msg = "Cloning inside a workspace is only allowed for shareable nodes."; + String msg = "Cloning inside a workspace is only allowed for shareable nodes. Node with type " + srcState.getNodeTypeName() + " is not shareable."; log.debug(msg); throw new RepositoryException(msg); } @@ -312,14 +312,14 @@ NodeId destParentId = destParentState.getNodeId(); if (destParentId.equals(srcId) || hierMgr.isAncestor(srcId, destParentId)) { - String msg = "This would create a share cycle."; + String msg = "Cloning Node with id " + srcId.getUUID() + " to parent with id " + destParentId.getUUID() + " would create a share cycle."; log.debug(msg); throw new RepositoryException(msg); } // 5. do clone operation (modify and store affected states) if (!srcState.addShare(destParentState.getNodeId())) { - String msg = "Adding a shareable node twice to the same parent is not supported."; + String msg = "Adding a shareable node with id (" + destParentState.getNodeId().getUUID() + ") twice to the same parent is not supported."; log.debug(msg); throw new UnsupportedRepositoryOperationException(msg); } @@ -413,7 +413,7 @@ int ind = destName.getIndex(); if (ind > 0) { // subscript in name element - String msg = "invalid destination path (subscript in name element is not allowed)"; + String msg = "invalid copy destination path: " + safeGetJCRPath(destPath) + " (subscript in name element is not allowed)"; log.debug(msg); throw new RepositoryException(msg); } @@ -514,7 +514,7 @@ // check precondition if (!stateMgr.inEditMode()) { - throw new IllegalStateException("not in edit mode"); + throw new IllegalStateException("cannot move path " + safeGetJCRPath(srcPath) + " because manager is not in edit mode"); } // 1. check paths & retrieve state @@ -527,7 +527,7 @@ throw new RepositoryException(msg); } } catch (MalformedPathException mpe) { - String msg = "invalid path: " + safeGetJCRPath(destPath); + String msg = "invalid path for move: " + safeGetJCRPath(destPath); log.debug(msg); throw new RepositoryException(msg, mpe); } @@ -573,7 +573,7 @@ } else { // check shareable case if (target.isShareable()) { - String msg = "Moving a shareable node is not supported."; + String msg = "Moving a shareable node (" + safeGetJCRPath(srcPath) + " ) is not supported."; log.debug(msg); throw new UnsupportedRepositoryOperationException(msg); } @@ -629,7 +629,7 @@ // check precondition if (!stateMgr.inEditMode()) { - throw new IllegalStateException("not in edit mode"); + throw new IllegalStateException("cannot remove node (" + safeGetJCRPath(nodePath) + ") because manager is not in edit mode"); } // 1. retrieve affected state @@ -1104,7 +1104,7 @@ // check precondition if (!stateMgr.inEditMode()) { - throw new IllegalStateException("not in edit mode"); + throw new IllegalStateException("cannot create node state for " + nodeName + " because manager is not in edit mode"); } NodeDef def = findApplicableNodeDefinition(nodeName, nodeTypeName, parent); @@ -1226,7 +1226,7 @@ // check precondition if (!stateMgr.inEditMode()) { - throw new IllegalStateException("not in edit mode"); + throw new IllegalStateException("cannot create property state for " + propName + " because manager is not in edit mode"); } // find applicable definition @@ -1750,7 +1750,7 @@ // or an ancestor thereof if (id.equals(destParentId) || hierMgr.isAncestor(id, destParentId)) { - String msg = "cannot remove ancestor node"; + String msg = "cannot remove node " + safeGetJCRPath(srcPath) + " because it is an ancestor of the destination"; log.debug(msg); throw new RepositoryException(msg); } @@ -1768,7 +1768,7 @@ } break; default: - throw new IllegalArgumentException("unknown flag"); + throw new IllegalArgumentException("unknown flag for copying node state: " + flag); } newState = stateMgr.createNew(id, srcState.getNodeTypeName(), destParentId); // copy node state @@ -1808,7 +1808,7 @@ if (stateMgr.hasItemState(mappedId)) { NodeState destState = (NodeState) stateMgr.getItemState(mappedId); if (!destState.isShareable()) { - String msg = "Remapped child is not shareable."; + String msg = "Remapped child (" + safeGetJCRPath(srcPath) + ") is not shareable."; throw new ItemStateException(msg); } if (!destState.addShare(id)) {