NodeImpl parentNode;
Path parentPath = path.getAncestor(1);
try {
parentNode = itemMgr.getNode(parentPath);
} catch (PathNotFoundException e) {
if (itemMgr.propertyExists(parentPath)) {
throw new ConstraintViolationException(
"Unable to add a child node to property "
+ context.getJCRPath(parentPath));
}
throw e;