I defined this node type
<nodeType name="my:orderable" isMixin="false"
hasOrderableChildNodes="true">
<supertypes>
<supertype>nt:unstructured</supertype>
</supertypes>
<propertyDefinition name="my:type" requiredType="String"
autoCreated="false" mandatory="true"
onParentVersion="COPY" protected="false"
multiple="false"/>
</nodeType>
And this namespace
"my" -> "http://localhost"
This is my code:
Node parent = (Node) session.getItem(parentPath);
Node node = parent.addNode(JcrUtils.escapeName(nodeName),
"my:orderable");
node.addMixin("mix:referenceable");
node.setProperty("my:type", "image");
...
session.save();
I get the following exception:
javax.jcr.nodetype.ConstraintViolationException: /Top Level Category:
mandatory property {http://localhost}type does not exist
I specifically added the property, yet I'm still getting this exception.
I noticed this comment org.apache.jackrabbit.core.ItemImpl:
/**
* todo FIXME workaround for mix:versionable:
* the mandatory properties are initialized at a
* later stage and might not exist yet
*/
Does this apply to all mandatory properties?
Any ideas on how to fix this problem?
Thanks,
Jared