//
PropertyDefinition def = JCR.findPropertyDefinition(node, propertyName);
//
if (def == null) {
throw new NoSuchPropertyException("Property " + propertyName + " cannot be set on node " + node.getPath() + " with type " + node.getPrimaryNodeType().getName());
}
//
if (jcrValue != null) {
int neededType = def.getRequiredType();