jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chetan Mehrotra <chetan.mehro...@gmail.com>
Subject Re: Return value for setting the property value to null using Node.setProperty
Date Mon, 29 Oct 2012 11:03:53 GMT
Did not saw the issue OAK-395 (Thanks Michael!!). That change would
break package import in such scenarios. Would follow up on the JIRA

Chetan Mehrotra


On Sat, Oct 27, 2012 at 11:33 PM, Chetan Mehrotra
<chetan.mehrotra@gmail.com> wrote:
> While importing a content package using current Oak codebase I am
> getting following exception
>
> 5203 [main] ERROR
> com.day.jcr.vault.packaging.impl.JcrPackageDefinitionImpl - error
> while saving properties.
> javax.jcr.PathNotFoundException: buildCount not found on
> /etc/packages/adobe/granite/com.adobe.granite.platform.content-0.2.44.zip/jcr:content/vlt:definition
>         at org.apache.jackrabbit.oak.jcr.NodeImpl$11.perform(NodeImpl.java:557)
>         at org.apache.jackrabbit.oak.jcr.NodeImpl$11.perform(NodeImpl.java:551)
>         at org.apache.jackrabbit.oak.jcr.SessionDelegate.perform(SessionDelegate.java:120)
>         at org.apache.jackrabbit.oak.jcr.NodeImpl.getProperty(NodeImpl.java:551)
>         at org.apache.jackrabbit.oak.jcr.NodeImpl$32.perform(NodeImpl.java:1493)
>         at org.apache.jackrabbit.oak.jcr.NodeImpl$32.perform(NodeImpl.java:1489)
>         at org.apache.jackrabbit.oak.jcr.SessionDelegate.perform(SessionDelegate.java:120)
>         at org.apache.jackrabbit.oak.jcr.NodeImpl.internalSetProperty(NodeImpl.java:1489)
>         at org.apache.jackrabbit.oak.jcr.NodeImpl.setProperty(NodeImpl.java:369)
>         at com.day.jcr.vault.packaging.impl.JcrPackageDefinitionImpl.writeProperties(JcrPackageDefinitionImpl.java:394)
>         at com.day.jcr.vault.packaging.impl.JcrPackageDefinitionImpl.unwrap(JcrPackageDefinitionImpl.java:222)
>         at com.day.jcr.vault.packaging.impl.JcrPackageImpl.createNew(JcrPackageImpl.java:219)
>         at com.day.jcr.vault.packaging.impl.JcrPackageManagerImpl.upload(JcrPackageManagerImpl.java:234)
>         at com.day.jcr.vault.packaging.impl.JcrPackageManagerImpl.upload(JcrPackageManagerImpl.java:183)
>
> Here the value of 'buildCount' is being set to null. As per JCR spec
> setting null is equivalent to removing the property. The problem is
> NodeImpl.internalSetProperty first looks up the property and then
> removes it which leads to PathNotFoundException as property does not
> exist earlier. Earlier this code used to return null. However even
> that behaviour differs from the current JR 2.0 logic, which first
> creates such a property and then removes it and returns a
> PropertyImpl.
>
> So what should be the behaviour here
>
> 1. Return null
> 2. OR return a PropertyImpl even for property which does not existed earlier.
>
> Chetan Mehrotra

Mime
View raw message