jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Fried <dfr...@phoenix-int.com>
Subject Unable to save node?
Date Mon, 15 Dec 2008 22:07:15 GMT

I need to store some custom data on version nodes - specifically, the ID
(from my authentication system) of the user who checked the content in. 
However, since nt:version and its nt:frozenNode children are protected,
there is no good way to do this.

One thing I tried to do was to un-protect the frozen node so I could add
mixins and additional properties.  For various reasons, it doesn't matter to
me that the frozen node is not protected.  However, I am running into some
problems modifying the (unprotected) frozen node after doing the checkin. 
Here's a simplified version of my code:

Version v= item.checkin();
Node frozenNode = v.getNode(JcrConstants.JCR_FROZENNODE);
frozenNode.addMixin(/* my custom mixin */);
frozenNode.setProperty(/* my custom property */);
frozenNode.save(); // THIS THROWS AN EXCEPTION

The exception ends up being deep in the Jackrabbit code:

javax.jcr.RepositoryException:
/jcr:system/jcr:versionStorage/3d/d5/ce/3dd5ceba-6fa5-4146-8816-ed4389904edd/1.0/jcr:frozenNode:
unable to update item.: 0144833b-b6c7-4ad6-8744-8e5c55053d08:
0144833b-b6c7-4ad6-8744-8e5c55053d08

caused by:

org.apache.jackrabbit.core.state.ItemStateException:
0144833b-b6c7-4ad6-8744-8e5c55053d08
        at
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.store(BundleDbPersistenceManager.java:546)
        at
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:704)
        at
org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:873)
        at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:334)
        at
org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:337)
        at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:310)
        at
org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:317)
        at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1247)

I'm not sure what I'm doing wrong here.  Is it possible at all to modify the
subtree of the repository rooted at the Version node returned by checkin()? 
There may be other ways to handle this, but none are nearly as pretty.
-- 
View this message in context: http://www.nabble.com/Unable-to-save-node--tp21022922p21022922.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message