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] Commented: (JCR-1148) NullPointerException in ItemState
Date Wed, 03 Oct 2007 07:52:50 GMT

    [ https://issues.apache.org/jira/browse/JCR-1148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532033
] 

Martijn Hendriks commented on JCR-1148:
---------------------------------------

Here are the stacktraces of two threads involved in the NPE:

The thread that throws the NPE (line information in ItemState has been changed due to debugging
code):

Thread [Thread-38] (Suspended (breakpoint at line 158 in ItemState))	
	NodeState(ItemState).pull() line: 158	
	XAItemStateManager(LocalItemStateManager).stateModified(ItemState) line: 420	
	StateChangeDispatcher.notifyStateModified(ItemState) line: 85	
	SharedItemStateManager.stateModified(ItemState) line: 390	
	NodeState(ItemState).notifyStateUpdated() line: 244	
	ChangeLog.persisted() line: 271	
	SharedItemStateManager$Update.end() line: 702	
	SharedItemStateManager.update(ChangeLog, EventStateCollectionFactory) line: 855	
	XAItemStateManager(LocalItemStateManager).update(ChangeLog) line: 326	
	XAItemStateManager.update(ChangeLog) line: 313	
	XAItemStateManager(LocalItemStateManager).update() line: 302	
	SessionItemStateManager.update() line: 306	
	NodeImpl(ItemImpl).save() line: 1214	
	XASessionImpl(SessionImpl).save() line: 849	

The thread that just reset the overlayedState of the ItemState in the above thread to null:

	ItemState.disconnect(ItemState.java:209)
	ChangeLog.modified(ChangeLog.java:70)
	LocalItemStateManager.store(LocalItemStateManager.java:268)
	SessionItemStateManager.store(SessionItemStateManager.java:283)
	NodeImpl.makePersistent(NodeImpl.java:984)
	ItemImpl.persistTransientItems(ItemImpl.java:687)
	ItemImpl.save(ItemImpl.java:1198)
	SessionImpl.save(SessionImpl.java:849)

The problem is that saving causes a call to disconnect of an ItemState of the LocalItemStateManager,
and that saving another session in another thread causes a call to pull of that ItemState
through the SISM notification mechanism.

> NullPointerException in ItemState
> ---------------------------------
>
>                 Key: JCR-1148
>                 URL: https://issues.apache.org/jira/browse/JCR-1148
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.3
>            Reporter: Martijn Hendriks
>
> The following happens quite regularly when multiple threads are adding, retrieving and
removing nodes simultaneously. Looking at the code of the pull method, this seems due to under-synchronization
somewhere as overlayedState was tested at line 153 for null.
> java.lang.NullPointerException
>         at org.apache.jackrabbit.core.state.ItemState.pull(ItemState.java:156)
>         at org.apache.jackrabbit.core.state.LocalItemStateManager.stateModified(LocalItemStateManager.java:421)
>         at org.apache.jackrabbit.core.state.StateChangeDispatcher.notifyStateModified(StateChangeDispatcher.java:85)
>         at org.apache.jackrabbit.core.state.SharedItemStateManager.stateModified(SharedItemStateManager.java:434)
>         at org.apache.jackrabbit.core.state.ItemState.notifyStateUpdated(ItemState.java:241)
>         at org.apache.jackrabbit.core.state.ChangeLog.persisted(ChangeLog.java:271)
>         at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:741)
>         at org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:937)
>         at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:327)
>         at org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:313)
>         at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:303)
>         at org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:307)
>         at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1374)

-- 
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