jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jared Graber" <jared.gra...@IACcap.com>
Subject Mandatory Property Error
Date Fri, 04 Apr 2008 16:28:43 GMT
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

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message