9 Replies Latest reply on Aug 30, 2012 4:24 AM by Simone L

    ConstraintViolationException after modification over CND

    Simone L Newbie

      Hi,

      I'm using Modeshape 2.8.2.Final on JBOSS 5.1.1 EAP.

      I've installed Modeshape using the JBOSS package and I've modified the datasource using JPASource and using a JNDI name.

      Everything seems to work fine except when I modify the CND file referenced in the configuration file.

      The CND file defines only two mixins with few properties; I use these 2 mixin on nt:folder and nt:file to track additional information.

      After I've modified it, adding a new property, when I try to insert a new node with the newly added property the following exception is raised:

       

      Caused by: javax.jcr.nodetype.ConstraintViolationException: Cannot find a definition for the property named '<PROPERTY_NAME>' on the node at '<FILE_PATH>' with primary type 'nt:file' and mixin types: [mix:versionable, cf:File]

          at org.modeshape.jcr.SessionCache$NodeEditor.setProperty(SessionCache.java:1144)

          at org.modeshape.jcr.SessionCache$NodeEditor.setProperty(SessionCache.java:1056)

          at org.modeshape.jcr.AbstractJcrNode.setProperty(AbstractJcrNode.java:1755)

       

      I've invoked on ValueFactory the method createValue(long).

       

      Considering that deleting the database solves the problem, I think the problem is related to the fact that the CND configuration is not reflected on the database, probably I've missed some flag in the configuration file?

      Can you help me?