You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Sunil Dhage <su...@coreobjects.com> on 2009/09/14 10:22:02 UTC

problem in accessing versioned nodes.

Hi,

I am facing problem while getting the properties stored in a node, which is versioned one.

I could successfully get the version history, versionIterator and the version.getCreated().getTime().toString().

But I want to see the properties of each version.  I am getting this exception

Exception in thread "main" javax.jcr.PathNotFoundException: anyProperty
        at org.apache.jackrabbit.core.NodeImpl.getProperty(NodeImpl.java:2761)

Can you please help me in providing appropriate example regarding accessing properties of a versioned node.

Thanks in anticipation,

Regards,
Sunil

Re: problem in accessing versioned nodes.

Posted by Sébastien Launay <se...@anyware-tech.com>.
Hi Sunil,

As described in the JCR Spec [1], properties and child nodes
versionables are stored in a node below the Version node.

You need to use :
version.getNode("jcr:frozenNode").getProperty("anyProperty");

Note that the former node and the frozen one differs on some
properties like UUID [2].

[1] http://www.day.com/specs/jcr/1.0/8.2.2.5_nt_version.html
[2] http://www.day.com/specs/jcr/1.0/8.2.2.6_nt_frozenNode.html

--
Sébastien Launay

Le 14/09/2009 10:22, Sunil Dhage a écrit :
> Hi,
>
> I am facing problem while getting the properties stored in a node, which is versioned one.
>
> I could successfully get the version history, versionIterator and the version.getCreated().getTime().toString().
>
> But I want to see the properties of each version.  I am getting this exception
>
> Exception in thread "main" javax.jcr.PathNotFoundException: anyProperty
>         at org.apache.jackrabbit.core.NodeImpl.getProperty(NodeImpl.java:2761)
>
> Can you please help me in providing appropriate example regarding accessing properties of a versioned node.
>
> Thanks in anticipation,
>
> Regards,
> Sunil