jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Error on setProperty
Date Tue, 19 Jul 2005 11:53:32 GMT
Hi Richard,

a relative path is not allowed to identify a property in setProperty.

Please read:
http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Node.html#setProperty(java.lang.String,%20boolean)

regards
  marcel

Richard Osbaldeston wrote:
> Still relatively new to JCR/JackRabbit so not entriely sure I'm not 
> doing something very wrong here, but I've some code thats trying to set 
> a property on a child node (wmnt:trainingData) like this:
> 
> node.setProperty("wmnt:trainingData/wmpt:taxonomyData", "bob");
> 
> Which cause the following exception (build #216173):
> 
> |javax.jcr.RepositoryException: invalid property name: 
> wmnt:trainingData/wmpt:taxonomyData: 
> 'wmnt:trainingData/wmpt:taxonomyData' is not a valid name: 
> 'wmnt:trainingData/wmpt:taxonomyData' is not a valid name
>    at 
> org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:408)
>    at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2002)
>    at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:1986)
>    at 
> com.wordmap.classification.repository.jcrbased.MarshallingVisitorTest.testMetaData(MarshallingVisitorTest.java:123)

> 
>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> 
>    at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

> 
>    at 
> com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57) 
> 
>    at 
> com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)

> 
>    at 
> com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97)

> 
>    at 
> com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> 
>    at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

> 
>    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
> Caused by: org.apache.jackrabbit.name.IllegalNameException: 
> 'wmnt:trainingData/wmpt:taxonomyData' is not a valid name
>    at org.apache.jackrabbit.name.QName.parse(QName.java:260)
>    at org.apache.jackrabbit.name.QName.fromJCRName(QName.java:154)
>    at 
> org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:406)
>    ... 26 more
> |
> Whereas if I navigate to the node and call setProperty() it works just 
> fine, i.e.
> 
>        assertNotNull(node = node.getNode("wmnt:trainingData"));
>        node.setProperty("wmpt:taxonomyData", "bob");
> 
> Can I use paths in setProperty()? getProperty() certainly allows them.. 
> or is it a bug?
> 
> - Richard
> 
> 

Mime
View raw message