You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Suat Gönül <su...@gmail.com> on 2011/08/19 15:33:13 UTC

Failed to get values of URI typed properties

Hi everybody,

I can create a URI typed property for a node and set its value by a code
snippet as follows:
*
Node n;
//somehow initialize the node
String uriprop = "uriprop";
String val = "http://www.example.org";
n.setProperty(uriprop, val, PropertyType.URI);*

After this code, when I try to get the value I set with the code below,
"javax.jcr.ValueFormatException: Unknown value type 11" exception is thrown.
*
Property p = n.getProperty(uriprop);
p.getValue();*

Is this a bug, or is there any way to get values of URI typed properties?

BTW, I also tried set the value through
*session.getValueFactory().createValue(val,
PropertyType.URI), *but this code also throws the same exception. I also
tried to obtain string value with *p.getString(), *but again the same
exception.

As far as I see, this property is not handled in *
org.apache.jackrabbit.rmi.value.SerialValueFactory* class though I am not
sure it is the exact responsible class from the property value retrieval.

Best,
Suat

Re: Failed to get values of URI typed properties

Posted by Suat Gönül <su...@gmail.com>.
2011/8/19 Stefan Guggisberg <st...@gmail.com>

> 2011/8/19 Suat Gönül <su...@gmail.com>:
> > Hi everybody,
> >
> > I can create a URI typed property for a node and set its value by a code
> > snippet as follows:
> >
> > Node n;
> > //somehow initialize the node
> > String uriprop = "uriprop";
> > String val = "http://www.example.org";
> > n.setProperty(uriprop, val, PropertyType.URI);
> >
> > After this code, when I try to get the value I set with the code below,
> > "javax.jcr.ValueFormatException: Unknown value type 11" exception is
> thrown.
> >
> > Property p = n.getProperty(uriprop);
> > p.getValue();
> >
> > Is this a bug, or is there any way to get values of URI typed properties?
>
> you're accessing the repository through RMI, right?
>
>
Yes, through RMI.


> it seems that jackrabbit-jcr-rmi doesn't yet support all new JCR 2.0
> property types.
>
> here's the related container issue:
> https://issues.apache.org/jira/browse/JCRRMI-26
>
>
Thanks for the pointer. I also get another exceptions regarding this issue,
but I think I should wait for the implementation.

Best,
Suat


> cheers
> stefan
>
> >
> > BTW, I also tried set the value through
> > session.getValueFactory().createValue(val, PropertyType.URI), but this
> code
> > also throws the same exception. I also tried to obtain string value with
> > p.getString(), but again the same exception.
> >
> > As far as I see, this property is not handled in
> > org.apache.jackrabbit.rmi.value.SerialValueFactory class though I am not
> > sure it is the exact responsible class from the property value retrieval.
> >
> > Best,
> > Suat
>

Re: Failed to get values of URI typed properties

Posted by Stefan Guggisberg <st...@gmail.com>.
2011/8/19 Suat Gönül <su...@gmail.com>:
> Hi everybody,
>
> I can create a URI typed property for a node and set its value by a code
> snippet as follows:
>
> Node n;
> //somehow initialize the node
> String uriprop = "uriprop";
> String val = "http://www.example.org";
> n.setProperty(uriprop, val, PropertyType.URI);
>
> After this code, when I try to get the value I set with the code below,
> "javax.jcr.ValueFormatException: Unknown value type 11" exception is thrown.
>
> Property p = n.getProperty(uriprop);
> p.getValue();
>
> Is this a bug, or is there any way to get values of URI typed properties?

you're accessing the repository through RMI, right?

it seems that jackrabbit-jcr-rmi doesn't yet support all new JCR 2.0
property types.

here's the related container issue:
https://issues.apache.org/jira/browse/JCRRMI-26

cheers
stefan

>
> BTW, I also tried set the value through
> session.getValueFactory().createValue(val, PropertyType.URI), but this code
> also throws the same exception. I also tried to obtain string value with
> p.getString(), but again the same exception.
>
> As far as I see, this property is not handled in
> org.apache.jackrabbit.rmi.value.SerialValueFactory class though I am not
> sure it is the exact responsible class from the property value retrieval.
>
> Best,
> Suat