You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Guy Spillman <gs...@hal-inc.com> on 2007/03/13 00:12:22 UTC

Re: nodetype.ConstraintViolationException: no matching property definition found for {}

I'm getting a similar error.  All I'm doing is creating
a nt:file node, and setting a new property as a string
value.  I've tried both of the following:

Node fileNode = node.addNode("FormData.xml","nt:file");
fileNode.setProperty("RevisionLabel", "1");

and 

Node fileNode = node.addNode("FormData.xml","nt:file");
fileNode.setProperty("RevisionLabel", "1",
PropertyType.STRING);

I'm am currently running JackRabbit on Weblogic 8.1sp6
and JDK 1.4.2_06.  I updated JackRabbit from 1.1.1 to
1.2.2 last Monday (Mar 5th), and had no problems until
today.  I have tried upgrading to 1.2.3, and
downgrading to the original 1.1.1, both give me the
same error.  The Exception I'm getting is as follows:

javax.jcr.nodetype.ConstraintViolationException: no
matching property definition found for {}RevisionLabel
at
org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef(EffectiveNodeType.java:775)
at
org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:926)
at
org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:457)
at
org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:407)
at
org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2121)

Guy Spillman

On Mon, 12 Mar 2007 12:29:58 -0700 (PDT), Sudhan wrote:

> 
> 
> Hello,
> 
> I am developing a application which requires to set
> custom property on
> either jcr:content node, nt:file node or nt:version
> node. Let me explain you
> how this works :
> 
> I have a listener which listens to
> "/jcr:system/jcr:versionStorage", on any
> node added to versionStorage. The events are getting
> triggered when i add or
> update any node by updating jcr:data property of
> jcr:content node (which is
> versionable).
> 
> Now my problem is when i get this event and my
> application processes the
> size of the updated file, i need some mechanism to put
> back the size of the
> file as a property on this versionable node. 
> 
> I am able to prepopulate and set property "size" on
> versionable node and
> when i try to update this property by, check out,
> update and checkin there
> is one more verisonable node added to that
> versionStorage (which i do not
> want ).
> 
> Now when i try to insert a new property by setting
> setProperty("size","292"); to a nt:file node i am
> getting following
> constraintViolationExcpetion : 
> 
> nodetype.ConstraintViolationException: no matching
> property definition found
> for {}deltaSize
> 
>
org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:102)
> 
>
org.apache.jackrabbit.rmi.server.ServerNode.setProperty(ServerNode.java:249)
>  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> 
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>  java.lang.reflect.Method.invoke(Method.java:585)
> 
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
>  sun.rmi.transport.Transport$1.run(Transport.java:153)
>  java.security.AccessController.doPrivileged(Native
> Method)
> 
sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 
>
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
>  java.lang.Thread.run(Thread.java:595)
> 
>
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
>  sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 
org.apache.jackrabbit.rmi.server.ServerNode_Stub.setProperty(Unknown
> Source)
> 
>
org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:127)
> 
>
org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:173)
> 
>
com.idcglobal.cloe.VersioningTest.testRepositoryCheck(VersioningTest.java:119)
>  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> 
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>  java.lang.reflect.Method.invoke(Method.java:585)
>  junit.framework.TestCase.runTest(TestCase.java:154)
>  junit.framework.TestCase.runBare(TestCase.java:127)
> 
junit.framework.TestResult$1.protect(TestResult.java:106)
> 
junit.framework.TestResult.runProtected(TestResult.java:124)
>  junit.framework.TestResult.run(TestResult.java:109)
>  junit.framework.TestCase.run(TestCase.java:118)
>  junit.framework.TestSuite.runTest(TestSuite.java:208)
>  junit.framework.TestSuite.run(TestSuite.java:203)
>  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> 
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>  java.lang.reflect.Method.invoke(Method.java:585)
> 
org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
> 
>
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
> 
>
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
> 
org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> 
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>  java.lang.reflect.Method.invoke(Method.java:585)
> 
>
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
> 
>
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
>  1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
> 1.031 sec <<< FAILURE!
> 
> Now my question is that, is there a way to update or
> insert a new property -
> size onto a non-versioned parent node or any other way
> to update property to
> versioned node without incrementing version number.
> 
> Once again thanks for your help and would appreciate
> any pointers or help in
> this matter.
> 
> thanks,
> 
> Sudhan
> -- 
> View this message in context:
>
http://www.nabble.com/nodetype.ConstraintViolationException%3A-no-matching-property-definition-found-for-%7B%7D-tf3391684.html#a9441553
> Sent from the Jackrabbit - Users mailing list archive
> at Nabble.com.

Re: nodetype.ConstraintViolationException: no matching property definition found for {}

Posted by Sudhan <s....@gmail.com>.
I am getting  org.apache.jackrabbit.rmi.client.ClientNodeTypeManager when i
do the suggested stuff.

But i do not know how to register my cnd file for RMI client. I had
typecasted to ClientJackrabbitNodeTypeManager but again i am getting
ClassCast Exception.

is there a way to register cnd when the ws.getNodeTypeManager() is returning
ClientNodeTypeManager ??

thanks,

Sudhan


Brian Thompson-5 wrote:
> 
> What does
> 
> session.getWorkspace().getNodeTypeManager().getClass();
> 
> show you?
> 
> That should help you pin down that ClassCastException.
> 
> 
> 
> On 4/2/07, Sudhan <s....@gmail.com> wrote:
>>
>>
>> Hi,
>>
>> I created a cnd file exactly given in
>> http://jackrabbit.apache.org/doc/nodetype/cnd.html
>>
>> But when i follow the code :
>>
>> Session session = ...;
>>     JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
>>         session.getWorkspace().getNodeTypeManager();
>>     // only register the type if it does not yet exist
>>     if (!manager.hasNodeType("myfile")) {
>>         manager.registerNodeTypes(
>>             JackrabbitNodeTypeManager.TEXT_X_JCR_CND,
>>             <InputStream for reading your CND file>);
>>     }
>>
>>
>> I am getting ClassCastException :
>>
>> java.lang.ClassCastException:
>> org.apache.jackrabbit.rmi.client.ClientNodeTypeManager
>>
>> Am I missing something before getting JackrabbitNodeTypeManager instance.
>>
>> thanks,
>>
>> Sudhan
>>
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/nodetype.ConstraintViolationException%3A-no-matching-property-definition-found-for-%7B%7D-tf3391684.html#a9817964
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: nodetype.ConstraintViolationException: no matching property definition found for {}

Posted by Brian Thompson <el...@gmail.com>.
What does

session.getWorkspace().getNodeTypeManager().getClass();

show you?

That should help you pin down that ClassCastException.



On 4/2/07, Sudhan <s....@gmail.com> wrote:
>
>
> Hi,
>
> I created a cnd file exactly given in
> http://jackrabbit.apache.org/doc/nodetype/cnd.html
>
> But when i follow the code :
>
> Session session = ...;
>     JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
>         session.getWorkspace().getNodeTypeManager();
>     // only register the type if it does not yet exist
>     if (!manager.hasNodeType("myfile")) {
>         manager.registerNodeTypes(
>             JackrabbitNodeTypeManager.TEXT_X_JCR_CND,
>             <InputStream for reading your CND file>);
>     }
>
>
> I am getting ClassCastException :
>
> java.lang.ClassCastException:
> org.apache.jackrabbit.rmi.client.ClientNodeTypeManager
>
> Am I missing something before getting JackrabbitNodeTypeManager instance.
>
> thanks,
>
> Sudhan
>
>
>

Re: nodetype.ConstraintViolationException: no matching property definition found for {}

Posted by Sudhan <s....@gmail.com>.
Hi,

I created a cnd file exactly given in
http://jackrabbit.apache.org/doc/nodetype/cnd.html

But when i follow the code :

 Session session = ...;
    JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
        session.getWorkspace().getNodeTypeManager();
    // only register the type if it does not yet exist
    if (!manager.hasNodeType("myfile")) {
        manager.registerNodeTypes(
            JackrabbitNodeTypeManager.TEXT_X_JCR_CND,
            <InputStream for reading your CND file>);
    }


I am getting ClassCastException :

java.lang.ClassCastException:
org.apache.jackrabbit.rmi.client.ClientNodeTypeManager

Am I missing something before getting JackrabbitNodeTypeManager instance.

thanks,

Sudhan


Jukka Zitting wrote:
> 
> Hi,
> 
> On 3/14/07, Lubos and Alena Pochman <po...@gmail.com> wrote:
>> I would be also interested in that. I would not mind doing it
>> programatically (if I know how 8-).
>> I read JSR-170 spec and jackrabbit website but could not find it,
>> probably
>> did not look hard enough 8-).
> 
> Our documentation is currently quite lacking, so in many cases you
> still need to resort to digging the list archives for the useful bits
> of information. I hope we can change that sooner rather than later,
> but for now you did exactly the right thing by asking the mailing
> list... :-)
> 
> So, the best way to create and register new node types is to first
> define them using the CND format (see
> http://jackrabbit.apache.org/doc/nodetype/cnd.html) and then use the
> custom JackrabbitNodeTypeManager API extension from the jackrabbit-api
> library to register the new types.
> 
> In this case the new node type definition could be something like this:
> 
>     [myfile] > nt:file
>     - RevisionLabel (STRING)
> 
> Once you have the CND file, you can use the JackrabbitNodeTypeManager
> API extension like this to register the node type:
> 
>     import org.apache.jackrabbit.api.JackrabbitNodeTypeManager;
> 
>     Session session = ...;
>     JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
>         session.getWorkspace().getNodeTypeManager();
>     // only register the type if it does not yet exist
>     if (!manager.hasNodeType("myfile")) {
>         manager.registerNodeTypes(
>             JackrabbitNodeTypeManager.TEXT_X_JCR_CND,
>             <InputStream for reading your CND file>);
>     }
> 
> Once you've done this, you can replace "nt:file" with "myfile" in your
> original code, and the "RevisionLabel" property will no longer cause
> trouble.
> 
> BR,
> 
> Jukka Zitting
> 
> 

-- 
View this message in context: http://www.nabble.com/nodetype.ConstraintViolationException%3A-no-matching-property-definition-found-for-%7B%7D-tf3391684.html#a9800170
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: [JCR Browser] nodetype.ConstraintViolationException: no matching property definition found for {}

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 3/14/07, Lubos and Alena Pochman <po...@gmail.com> wrote:
> I would be also interested in that. I would not mind doing it
> programatically (if I know how 8-).
> I read JSR-170 spec and jackrabbit website but could not find it, probably
> did not look hard enough 8-).

Our documentation is currently quite lacking, so in many cases you
still need to resort to digging the list archives for the useful bits
of information. I hope we can change that sooner rather than later,
but for now you did exactly the right thing by asking the mailing
list... :-)

So, the best way to create and register new node types is to first
define them using the CND format (see
http://jackrabbit.apache.org/doc/nodetype/cnd.html) and then use the
custom JackrabbitNodeTypeManager API extension from the jackrabbit-api
library to register the new types.

In this case the new node type definition could be something like this:

    [myfile] > nt:file
    - RevisionLabel (STRING)

Once you have the CND file, you can use the JackrabbitNodeTypeManager
API extension like this to register the node type:

    import org.apache.jackrabbit.api.JackrabbitNodeTypeManager;

    Session session = ...;
    JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
        session.getWorkspace().getNodeTypeManager();
    // only register the type if it does not yet exist
    if (!manager.hasNodeType("myfile")) {
        manager.registerNodeTypes(
            JackrabbitNodeTypeManager.TEXT_X_JCR_CND,
            <InputStream for reading your CND file>);
    }

Once you've done this, you can replace "nt:file" with "myfile" in your
original code, and the "RevisionLabel" property will no longer cause
trouble.

BR,

Jukka Zitting

Re: [JCR Browser] nodetype.ConstraintViolationException: no matching property definition found for {}

Posted by Lubos and Alena Pochman <po...@gmail.com>.
I would be also interested in that. I would not mind doing it
programatically (if I know how 8-).
I read JSR-170 spec and jackrabbit website but could not find it, probably
did not look hard enough 8-).

On 3/13/07, Sudhan <s....@gmail.com> wrote:
>
>
> Hi Guy,
>
> Sorry, i am new to this CMS:jackrabbit, can you tell me how to define
> those
> custom node types. Is there a configuration setting where i can add or
> update any of the xml configuration and add my custom nodetype.
>
> Do you have a example ?
>
> thanks,
>
> Sudhan
>
>
> Stefan Guggisberg wrote:
> >
> > On 3/13/07, Guy Spillman <gs...@hal-inc.com> wrote:
> >> I'm getting a similar error.  All I'm doing is creating
> >> a nt:file node, and setting a new property as a string
> >> value.  I've tried both of the following:
> >>
> >> Node fileNode = node.addNode("FormData.xml","nt:file");
> >> fileNode.setProperty("RevisionLabel", "1");
> >>
> >> and
> >>
> >> Node fileNode = node.addNode("FormData.xml","nt:file");
> >> fileNode.setProperty("RevisionLabel", "1",
> >> PropertyType.STRING);
> >>
> >> I'm am currently running JackRabbit on Weblogic 8.1sp6
> >> and JDK 1.4.2_06.  I updated JackRabbit from 1.1.1 to
> >> 1.2.2 last Monday (Mar 5th), and had no problems until
> >> today.  I have tried upgrading to 1.2.3, and
> >> downgrading to the original 1.1.1, both give me the
> >> same error.  The Exception I'm getting is as follows:
> >>
> >> javax.jcr.nodetype.ConstraintViolationException: no
> >> matching property definition found for {}RevisionLabel
> >
> > this exception tells you that there's no matching property
> > definition for "RevisionLabel" in the given primary/mixin
> > types of the said node.
> >
> > you could e.g. create your own node type which declares
> > your required properties and which extends nt:file.
> >
> > cheers
> > stefan
> >
> >> at
> >>
> org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef
> (EffectiveNodeType.java:775)
> >> at
> >> org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition(
> NodeImpl.java:926)
> >> at
> >> org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java
> :457)
> >> at
> >> org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java
> :407)
> >> at
> >> org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2121)
> >>
> >> Guy Spillman
> >>
> >> On Mon, 12 Mar 2007 12:29:58 -0700 (PDT), Sudhan wrote:
> >>
> >> >
> >> >
> >> > Hello,
> >> >
> >> > I am developing a application which requires to set
> >> > custom property on
> >> > either jcr:content node, nt:file node or nt:version
> >> > node. Let me explain you
> >> > how this works :
> >> >
> >> > I have a listener which listens to
> >> > "/jcr:system/jcr:versionStorage", on any
> >> > node added to versionStorage. The events are getting
> >> > triggered when i add or
> >> > update any node by updating jcr:data property of
> >> > jcr:content node (which is
> >> > versionable).
> >> >
> >> > Now my problem is when i get this event and my
> >> > application processes the
> >> > size of the updated file, i need some mechanism to put
> >> > back the size of the
> >> > file as a property on this versionable node.
> >> >
> >> > I am able to prepopulate and set property "size" on
> >> > versionable node and
> >> > when i try to update this property by, check out,
> >> > update and checkin there
> >> > is one more verisonable node added to that
> >> > versionStorage (which i do not
> >> > want ).
> >> >
> >> > Now when i try to insert a new property by setting
> >> > setProperty("size","292"); to a nt:file node i am
> >> > getting following
> >> > constraintViolationExcpetion :
> >> >
> >> > nodetype.ConstraintViolationException: no matching
> >> > property definition found
> >> > for {}deltaSize
> >> >
> >> >
> >> org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(
> ServerObject.java:102)
> >> >
> >> >
> >> org.apache.jackrabbit.rmi.server.ServerNode.setProperty(ServerNode.java
> :249)
> >> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> > Method)
> >> >
> >> >
> >> sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> >> >
> >> >
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> >> >  java.lang.reflect.Method.invoke(Method.java:585)
> >> >
> >> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
> >> >  sun.rmi.transport.Transport$1.run(Transport.java:153)
> >> >  java.security.AccessController.doPrivileged(Native
> >> > Method)
> >> >
> >> sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> >> >
> >> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java
> :460)
> >> >
> >> >
> >> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(
> TCPTransport.java:701)
> >> >  java.lang.Thread.run(Thread.java:595)
> >> >
> >> >
> >> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(
> StreamRemoteCall.java:247)
> >> >
> >> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java
> :223)
> >> >  sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> >> >
> >> org.apache.jackrabbit.rmi.server.ServerNode_Stub.setProperty(Unknown
> >> > Source)
> >> >
> >> >
> >> org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java
> :127)
> >> >
> >> >
> >> org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java
> :173)
> >> >
> >> >
> >> com.idcglobal.cloe.VersioningTest.testRepositoryCheck(
> VersioningTest.java:119)
> >> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> > Method)
> >> >
> >> >
> >> sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> >> >
> >> >
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> >> >  java.lang.reflect.Method.invoke(Method.java:585)
> >> >  junit.framework.TestCase.runTest(TestCase.java:154)
> >> >  junit.framework.TestCase.runBare(TestCase.java:127)
> >> >
> >> junit.framework.TestResult$1.protect(TestResult.java:106)
> >> >
> >> junit.framework.TestResult.runProtected(TestResult.java:124)
> >> >  junit.framework.TestResult.run(TestResult.java:109)
> >> >  junit.framework.TestCase.run(TestCase.java:118)
> >> >  junit.framework.TestSuite.runTest(TestSuite.java:208)
> >> >  junit.framework.TestSuite.run(TestSuite.java:203)
> >> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> > Method)
> >> >
> >> >
> >> sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> >> >
> >> >
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> >> >  java.lang.reflect.Method.invoke(Method.java:585)
> >> >
> >> org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java
> :213)
> >> >
> >> >
> >>
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(
> AbstractDirectoryTestSuite.java:138)
> >> >
> >> >
> >> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(
> AbstractDirectoryTestSuite.java:125)
> >> >
> >> org.apache.maven.surefire.Surefire.run(Surefire.java:132)
> >> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> > Method)
> >> >
> >> >
> >> sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> >> >
> >> >
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> >> >  java.lang.reflect.Method.invoke(Method.java:585)
> >> >
> >> >
> >> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(
> SurefireBooter.java:290)
> >> >
> >> >
> >> org.apache.maven.surefire.booter.SurefireBooter.main(
> SurefireBooter.java:818)
> >> >  1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
> >> > 1.031 sec <<< FAILURE!
> >> >
> >> > Now my question is that, is there a way to update or
> >> > insert a new property -
> >> > size onto a non-versioned parent node or any other way
> >> > to update property to
> >> > versioned node without incrementing version number.
> >> >
> >> > Once again thanks for your help and would appreciate
> >> > any pointers or help in
> >> > this matter.
> >> >
> >> > thanks,
> >> >
> >> > Sudhan
> >> > --
> >> > View this message in context:
> >> >
> >>
> http://www.nabble.com/nodetype.ConstraintViolationException%3A-no-matching-property-definition-found-for-%7B%7D-tf3391684.html#a9441553
> >> > Sent from the Jackrabbit - Users mailing list archive
> >> > at Nabble.com.
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/nodetype.ConstraintViolationException%3A-no-matching-property-definition-found-for-%7B%7D-tf3391684.html#a9466196
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>

Re: [JCR Browser] nodetype.ConstraintViolationException: no matching property definition found for {}

Posted by Sudhan <s....@gmail.com>.
Hi Guy,

Sorry, i am new to this CMS:jackrabbit, can you tell me how to define those
custom node types. Is there a configuration setting where i can add or
update any of the xml configuration and add my custom nodetype.

Do you have a example ? 

thanks,

Sudhan


Stefan Guggisberg wrote:
> 
> On 3/13/07, Guy Spillman <gs...@hal-inc.com> wrote:
>> I'm getting a similar error.  All I'm doing is creating
>> a nt:file node, and setting a new property as a string
>> value.  I've tried both of the following:
>>
>> Node fileNode = node.addNode("FormData.xml","nt:file");
>> fileNode.setProperty("RevisionLabel", "1");
>>
>> and
>>
>> Node fileNode = node.addNode("FormData.xml","nt:file");
>> fileNode.setProperty("RevisionLabel", "1",
>> PropertyType.STRING);
>>
>> I'm am currently running JackRabbit on Weblogic 8.1sp6
>> and JDK 1.4.2_06.  I updated JackRabbit from 1.1.1 to
>> 1.2.2 last Monday (Mar 5th), and had no problems until
>> today.  I have tried upgrading to 1.2.3, and
>> downgrading to the original 1.1.1, both give me the
>> same error.  The Exception I'm getting is as follows:
>>
>> javax.jcr.nodetype.ConstraintViolationException: no
>> matching property definition found for {}RevisionLabel
> 
> this exception tells you that there's no matching property
> definition for "RevisionLabel" in the given primary/mixin
> types of the said node.
> 
> you could e.g. create your own node type which declares
> your required properties and which extends nt:file.
> 
> cheers
> stefan
> 
>> at
>> org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef(EffectiveNodeType.java:775)
>> at
>> org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:926)
>> at
>> org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:457)
>> at
>> org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:407)
>> at
>> org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2121)
>>
>> Guy Spillman
>>
>> On Mon, 12 Mar 2007 12:29:58 -0700 (PDT), Sudhan wrote:
>>
>> >
>> >
>> > Hello,
>> >
>> > I am developing a application which requires to set
>> > custom property on
>> > either jcr:content node, nt:file node or nt:version
>> > node. Let me explain you
>> > how this works :
>> >
>> > I have a listener which listens to
>> > "/jcr:system/jcr:versionStorage", on any
>> > node added to versionStorage. The events are getting
>> > triggered when i add or
>> > update any node by updating jcr:data property of
>> > jcr:content node (which is
>> > versionable).
>> >
>> > Now my problem is when i get this event and my
>> > application processes the
>> > size of the updated file, i need some mechanism to put
>> > back the size of the
>> > file as a property on this versionable node.
>> >
>> > I am able to prepopulate and set property "size" on
>> > versionable node and
>> > when i try to update this property by, check out,
>> > update and checkin there
>> > is one more verisonable node added to that
>> > versionStorage (which i do not
>> > want ).
>> >
>> > Now when i try to insert a new property by setting
>> > setProperty("size","292"); to a nt:file node i am
>> > getting following
>> > constraintViolationExcpetion :
>> >
>> > nodetype.ConstraintViolationException: no matching
>> > property definition found
>> > for {}deltaSize
>> >
>> >
>> org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:102)
>> >
>> >
>> org.apache.jackrabbit.rmi.server.ServerNode.setProperty(ServerNode.java:249)
>> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> > Method)
>> >
>> >
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> >  java.lang.reflect.Method.invoke(Method.java:585)
>> >
>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
>> >  sun.rmi.transport.Transport$1.run(Transport.java:153)
>> >  java.security.AccessController.doPrivileged(Native
>> > Method)
>> >
>> sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>> >
>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
>> >
>> >
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
>> >  java.lang.Thread.run(Thread.java:595)
>> >
>> >
>> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
>> >
>> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
>> >  sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
>> >
>> org.apache.jackrabbit.rmi.server.ServerNode_Stub.setProperty(Unknown
>> > Source)
>> >
>> >
>> org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:127)
>> >
>> >
>> org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:173)
>> >
>> >
>> com.idcglobal.cloe.VersioningTest.testRepositoryCheck(VersioningTest.java:119)
>> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> > Method)
>> >
>> >
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> >  java.lang.reflect.Method.invoke(Method.java:585)
>> >  junit.framework.TestCase.runTest(TestCase.java:154)
>> >  junit.framework.TestCase.runBare(TestCase.java:127)
>> >
>> junit.framework.TestResult$1.protect(TestResult.java:106)
>> >
>> junit.framework.TestResult.runProtected(TestResult.java:124)
>> >  junit.framework.TestResult.run(TestResult.java:109)
>> >  junit.framework.TestCase.run(TestCase.java:118)
>> >  junit.framework.TestSuite.runTest(TestSuite.java:208)
>> >  junit.framework.TestSuite.run(TestSuite.java:203)
>> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> > Method)
>> >
>> >
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> >  java.lang.reflect.Method.invoke(Method.java:585)
>> >
>> org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
>> >
>> >
>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
>> >
>> >
>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
>> >
>> org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> > Method)
>> >
>> >
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> >  java.lang.reflect.Method.invoke(Method.java:585)
>> >
>> >
>> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
>> >
>> >
>> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
>> >  1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
>> > 1.031 sec <<< FAILURE!
>> >
>> > Now my question is that, is there a way to update or
>> > insert a new property -
>> > size onto a non-versioned parent node or any other way
>> > to update property to
>> > versioned node without incrementing version number.
>> >
>> > Once again thanks for your help and would appreciate
>> > any pointers or help in
>> > this matter.
>> >
>> > thanks,
>> >
>> > Sudhan
>> > --
>> > View this message in context:
>> >
>> http://www.nabble.com/nodetype.ConstraintViolationException%3A-no-matching-property-definition-found-for-%7B%7D-tf3391684.html#a9441553
>> > Sent from the Jackrabbit - Users mailing list archive
>> > at Nabble.com.
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/nodetype.ConstraintViolationException%3A-no-matching-property-definition-found-for-%7B%7D-tf3391684.html#a9466196
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: nodetype.ConstraintViolationException: no matching property definition found for {}

Posted by Stefan Guggisberg <st...@gmail.com>.
On 3/13/07, Guy Spillman <gs...@hal-inc.com> wrote:
> I'm getting a similar error.  All I'm doing is creating
> a nt:file node, and setting a new property as a string
> value.  I've tried both of the following:
>
> Node fileNode = node.addNode("FormData.xml","nt:file");
> fileNode.setProperty("RevisionLabel", "1");
>
> and
>
> Node fileNode = node.addNode("FormData.xml","nt:file");
> fileNode.setProperty("RevisionLabel", "1",
> PropertyType.STRING);
>
> I'm am currently running JackRabbit on Weblogic 8.1sp6
> and JDK 1.4.2_06.  I updated JackRabbit from 1.1.1 to
> 1.2.2 last Monday (Mar 5th), and had no problems until
> today.  I have tried upgrading to 1.2.3, and
> downgrading to the original 1.1.1, both give me the
> same error.  The Exception I'm getting is as follows:
>
> javax.jcr.nodetype.ConstraintViolationException: no
> matching property definition found for {}RevisionLabel

this exception tells you that there's no matching property
definition for "RevisionLabel" in the given primary/mixin
types of the said node.

you could e.g. create your own node type which declares
your required properties and which extends nt:file.

cheers
stefan

> at
> org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef(EffectiveNodeType.java:775)
> at
> org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:926)
> at
> org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:457)
> at
> org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:407)
> at
> org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2121)
>
> Guy Spillman
>
> On Mon, 12 Mar 2007 12:29:58 -0700 (PDT), Sudhan wrote:
>
> >
> >
> > Hello,
> >
> > I am developing a application which requires to set
> > custom property on
> > either jcr:content node, nt:file node or nt:version
> > node. Let me explain you
> > how this works :
> >
> > I have a listener which listens to
> > "/jcr:system/jcr:versionStorage", on any
> > node added to versionStorage. The events are getting
> > triggered when i add or
> > update any node by updating jcr:data property of
> > jcr:content node (which is
> > versionable).
> >
> > Now my problem is when i get this event and my
> > application processes the
> > size of the updated file, i need some mechanism to put
> > back the size of the
> > file as a property on this versionable node.
> >
> > I am able to prepopulate and set property "size" on
> > versionable node and
> > when i try to update this property by, check out,
> > update and checkin there
> > is one more verisonable node added to that
> > versionStorage (which i do not
> > want ).
> >
> > Now when i try to insert a new property by setting
> > setProperty("size","292"); to a nt:file node i am
> > getting following
> > constraintViolationExcpetion :
> >
> > nodetype.ConstraintViolationException: no matching
> > property definition found
> > for {}deltaSize
> >
> >
> org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:102)
> >
> >
> org.apache.jackrabbit.rmi.server.ServerNode.setProperty(ServerNode.java:249)
> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >  java.lang.reflect.Method.invoke(Method.java:585)
> >
> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
> >  sun.rmi.transport.Transport$1.run(Transport.java:153)
> >  java.security.AccessController.doPrivileged(Native
> > Method)
> >
> sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> >
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> >
> >
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> >  java.lang.Thread.run(Thread.java:595)
> >
> >
> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> >
> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> >  sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> >
> org.apache.jackrabbit.rmi.server.ServerNode_Stub.setProperty(Unknown
> > Source)
> >
> >
> org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:127)
> >
> >
> org.apache.jackrabbit.rmi.client.ClientNode.setProperty(ClientNode.java:173)
> >
> >
> com.idcglobal.cloe.VersioningTest.testRepositoryCheck(VersioningTest.java:119)
> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >  java.lang.reflect.Method.invoke(Method.java:585)
> >  junit.framework.TestCase.runTest(TestCase.java:154)
> >  junit.framework.TestCase.runBare(TestCase.java:127)
> >
> junit.framework.TestResult$1.protect(TestResult.java:106)
> >
> junit.framework.TestResult.runProtected(TestResult.java:124)
> >  junit.framework.TestResult.run(TestResult.java:109)
> >  junit.framework.TestCase.run(TestCase.java:118)
> >  junit.framework.TestSuite.runTest(TestSuite.java:208)
> >  junit.framework.TestSuite.run(TestSuite.java:203)
> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >  java.lang.reflect.Method.invoke(Method.java:585)
> >
> org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
> >
> >
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
> >
> >
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
> >
> org.apache.maven.surefire.Surefire.run(Surefire.java:132)
> >  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >  java.lang.reflect.Method.invoke(Method.java:585)
> >
> >
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
> >
> >
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
> >  1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
> > 1.031 sec <<< FAILURE!
> >
> > Now my question is that, is there a way to update or
> > insert a new property -
> > size onto a non-versioned parent node or any other way
> > to update property to
> > versioned node without incrementing version number.
> >
> > Once again thanks for your help and would appreciate
> > any pointers or help in
> > this matter.
> >
> > thanks,
> >
> > Sudhan
> > --
> > View this message in context:
> >
> http://www.nabble.com/nodetype.ConstraintViolationException%3A-no-matching-property-definition-found-for-%7B%7D-tf3391684.html#a9441553
> > Sent from the Jackrabbit - Users mailing list archive
> > at Nabble.com.
>