jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martijn Hendriks (JIRA)" <j...@apache.org>
Subject [jira] Updated: (JCR-2168) Avoid premature publication of XAItemStateManager
Date Mon, 22 Jun 2009 18:24:07 GMT

     [ https://issues.apache.org/jira/browse/JCR-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Martijn Hendriks updated JCR-2168:
----------------------------------

    Attachment: JCR-2168.patch

Here's a possible solution which uses factory methods instead of public ctors.

> Avoid premature publication of XAItemStateManager
> -------------------------------------------------
>
>                 Key: JCR-2168
>                 URL: https://issues.apache.org/jira/browse/JCR-2168
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.5.6
>            Reporter: Martijn Hendriks
>         Attachments: JCR-2168.patch
>
>
> The XAItemStateManager constructor calls the super constructor (LocalItemStateManager)
 which registers the instance as a listener with the SharedItemStateManager. The construction
of the instance has not yet been finished, but it is accessible from the SharedItemStateManager.
This can result in strange exceptions like the following:
> java.lang.NullPointerException
>         at org.apache.jackrabbit.core.state.XAItemStateManager.stateModified(XAItemStateManager.java:580)
>         at org.apache.jackrabbit.core.state.StateChangeDispatcher.notifyStateModified(StateChangeDispatcher.java:111)
>         at org.apache.jackrabbit.core.state.SharedItemStateManager.stateModified(SharedItemStateManager.java:400)
>         at org.apache.jackrabbit.core.virtual.AbstractVISProvider.stateModified(AbstractVISProvider.java:445)
>         at org.apache.jackrabbit.core.state.ItemState.notifyStateUpdated(ItemState.java:244)

> The NPE is caused by the commitLogs field being null (it has not yet been initialized
to its final value).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message