Marcel,
I expect this is due to the setProperty() implementation you're using.
With multiple properties you must use one of the following:

 Property       setProperty(java.lang.String name, Value[] values)

 Property       setProperty(java.lang.String name, Value[] values, int type)

 
To create the Value[] you'll need to use do the following for each target
node:

getSession().getValueFactory().createValue(targetNode);

The exception you're seeing is the general exception thrown if there is a
mismatch in the value type you're using. 
Regards,
Shaun.

-----Original Message-----
From: Marcel Dullaart [mailto:[EMAIL PROTECTED] 
Sent: 15 January 2007 15:31
To: [email protected]
Subject: CND Notation: multiple properties that reference another node

Hi,

Recently I asked a question regarding referencing another node, which was
nicely answered.
Now I need to allow multiple references to a node and I'd also like to
restrict the node type that these properties refer to.
I used the following, but that seems to fail:

[epo:Tender]
> epo:Standard
- epo:expiryDate (DATE)
- epo:location
- epo:download (REFERENCE) multiple < 'epo:Resource'

With the following stack:
javax.jcr.nodetype.ConstraintViolationException: no matching property
definition found for {http://www.epo.org/epoline/ns}download
    at
org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyD
ef
(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:2120)
    at
org.epoline.portal.applications.sample.jcr.util.RegisterCNDTest.testAddTende
r
(RegisterCNDTest.java:409)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.extensions.TestSetup.run(TestSetup.java:23)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:478)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
RemoteTestRunner.java:344)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
RemoteTestRunner.java:196)

If I remove the multiple attribute:
[epo:Tender]
> epo:Standard
- epo:expiryDate (DATE)
- epo:location
- epo:download (REFERENCE) < 'epo:Resource'

the test case succeeds.
Is it not necessary to add the multiple attribute?

Thanks in advance,
Marcel Dullaart


                
___________________________________________________________ 
The all-new Yahoo! Mail goes wherever you go - free your email address from 
your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html

Reply via email to