Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-1953

Jackrabbit on JBoss: ItemStateCache seems to be invalid

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.5
    • Fix Version/s: None
    • Component/s: jackrabbit-jca
    • Labels:
      None
    • Environment:
      JBoss 4.2.2.GA

      Description

      I notice problems while removing nodes within EJB methods using the JCA-Adapter.

      I've created a test to reproduce the bug. But it only occueres some times.
      What i try to do is:
      1. create a node "a"
      2. add a child "a/b"
      3. remove node "a"
      Each of this steps runs in a new transaction.
      In my test-case i use container managed transactions but noticed a similay behavior
      with bean managed transaction.

      The Error occures in the 3. step. The jboss startup logs shows the following Exception[0]
      The jboss log shows the message :
      41bcdd97-3589-4095-a32e-aa1f60867744 has been modified externally[1]
      This is the id of node "a".
      I was also able to get the Exception causes the Transaction to fail:[2]

      Also i extracted the modCount of the given ItemState and its overlayItemState of node a before i try to remove it:
      15:16:33,401 INFO [STDOUT] state.modCount: 0 state.overlay.getModeCount: 1

      The "solution" i found was to do something like that before every new login:

      JCASessionHandle handle = (JCASessionHandle)session;
      ItemManager itemManager=((XASessionImpl)handle.getManagedConnection().getSession(handle)).getItemManager();
      Method m = itemManager.getClass().getDeclaredMethod("dispose");
      m.setAccessible(true);
      m.invoke(itemManager);

      So the ItemStates seems to be out of sync or the ItemStateCache unvalid instances.

      [0]
      ERROR: java.lang.RuntimeException: javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state; nested exception is: java.lang.RuntimeException:
      javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted]
      Can't commit because the transaction is in aborted state

      [1]
      2009-01-20 15:16:33,464 DEBUG [org.apache.jackrabbit.core.state.SharedItemStateManager] 41bcdd97-3589-4095-a32e-aa1f60867744 has been modified externally

      [2]

      16:20:13,463 ERROR [STDERR] javax.transaction.xa.XAException
      16:20:13,464 ERROR [STDERR] at org.apache.jackrabbit.core.TransactionContext.prepare(TransactionContext.java:155)
      16:20:13,464 ERROR [STDERR] at org.apache.jackrabbit.core.XASessionImpl.commit(XASessionImpl.java:337)
      16:20:13,465 ERROR [STDERR] at org.apache.jackrabbit.jca.TransactionBoundXAResource.commit(TransactionBoundXAResource.java:39)
      16:20:13,465 ERROR [STDERR] at org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper.commit(JcaXAResourceWrapper.java:53)
      16:20:13,465 ERROR [STDERR] at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelOnePhaseCommit(XAResourceRecord.java:636)
      16:20:13,465 ERROR [STDERR] at com.arjuna.ats.arjuna.coordinator.BasicAction.onePhaseCommit(BasicAction.java:2619)
      16:20:13,465 ERROR [STDERR] at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1779)
      16:20:13,465 ERROR [STDERR] at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:88)
      16:20:13,466 ERROR [STDERR] at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
      16:20:13,466 ERROR [STDERR] at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
      16:20:13,466 ERROR [STDERR] at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
      16:20:13,466 ERROR [STDERR] at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
      16:20:13,466 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
      16:20:13,466 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
      16:20:13,466 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
      16:20:13,466 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:13,467 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
      16:20:13,467 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:13,467 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
      16:20:13,467 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:13,468 ERROR [STDERR] at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
      16:20:13,478 ERROR [STDERR] at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:115)
      16:20:13,478 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:13,479 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      16:20:13,479 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
      16:20:13,496 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:13,496 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
      16:20:13,496 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:13,496 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      16:20:13,496 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:13,496 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:335)
      16:20:13,497 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
      16:20:13,497 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      16:20:13,497 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
      16:20:13,511 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
      16:20:13,512 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
      16:20:13,512 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
      16:20:13,513 ERROR [STDERR] Caused by: org.apache.jackrabbit.core.TransactionException: Unable to prepare transaction.
      16:20:13,513 ERROR [STDERR] Caused by: org.apache.jackrabbit.core.TransactionException: Unable to prepare transaction.
      16:20:13,513 ERROR [STDERR] at org.apache.jackrabbit.core.state.XAItemStateManager.prepare(XAItemStateManager.java:155)
      16:20:13,513 ERROR [STDERR] at org.apache.jackrabbit.core.TransactionContext.prepare(TransactionContext.java:138)
      16:20:13,514 ERROR [STDERR] ... 36 more
      16:20:13,514 ERROR [STDERR] Caused by: org.apache.jackrabbit.core.state.StaleItemStateException: b0a65dc6-5180-4fe9-8f77-d09f0870b2cb has been modified externally
      16:20:13,514 ERROR [STDERR] at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:644)
      16:20:13,515 ERROR [STDERR] at org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:1054)
      16:20:13,515 ERROR [STDERR] at org.apache.jackrabbit.core.state.XAItemStateManager.prepare(XAItemStateManager.java:149)
      16:20:13,515 ERROR [STDERR] ... 37 more
      16:20:22,241 ERROR [STDERR] javax.transaction.xa.XAException
      16:20:22,241 ERROR [STDERR] at org.apache.jackrabbit.core.TransactionContext.prepare(TransactionContext.java:155)
      16:20:22,241 ERROR [STDERR] at org.apache.jackrabbit.core.XASessionImpl.commit(XASessionImpl.java:337)
      16:20:22,241 ERROR [STDERR] at org.apache.jackrabbit.jca.TransactionBoundXAResource.commit(TransactionBoundXAResource.java:39)
      16:20:22,241 ERROR [STDERR] at org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper.commit(JcaXAResourceWrapper.java:53)
      16:20:22,241 ERROR [STDERR] at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelOnePhaseCommit(XAResourceRecord.java:636)
      16:20:22,241 ERROR [STDERR] at com.arjuna.ats.arjuna.coordinator.BasicAction.onePhaseCommit(BasicAction.java:2619)
      16:20:22,242 ERROR [STDERR] at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1779)
      16:20:22,242 ERROR [STDERR] at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:88)
      16:20:22,242 ERROR [STDERR] at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
      16:20:22,242 ERROR [STDERR] at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
      16:20:22,242 ERROR [STDERR] at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
      16:20:22,243 ERROR [STDERR] at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
      16:20:22,243 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
      16:20:22,243 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
      16:20:22,243 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
      16:20:22,243 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:22,243 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
      16:20:22,244 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:22,244 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
      16:20:22,244 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:22,244 ERROR [STDERR] at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
      16:20:22,244 ERROR [STDERR] at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:115)
      16:20:22,244 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:22,244 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      16:20:22,244 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
      16:20:22,284 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:22,284 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
      16:20:22,284 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:22,284 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      16:20:22,284 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:22,284 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      16:20:22,284 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:335)
      16:20:22,285 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
      16:20:22,285 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      16:20:22,285 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
      16:20:22,285 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
      16:20:22,285 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
      16:20:22,285 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
      16:20:22,286 ERROR [STDERR] Caused by: org.apache.jackrabbit.core.TransactionException: Unable to prepare transaction.
      16:20:22,286 ERROR [STDERR] at org.apache.jackrabbit.core.state.XAItemStateManager.prepare(XAItemStateManager.java:155)
      16:20:22,286 ERROR [STDERR] at org.apache.jackrabbit.core.TransactionContext.prepare(TransactionContext.java:138)
      16:20:22,286 ERROR [STDERR] ... 36 more
      16:20:22,286 ERROR [STDERR] Caused by: org.apache.jackrabbit.core.state.StaleItemStateException: b0a65dc6-5180-4fe9-8f77-d09f0870b2cb has been modified externally
      16:20:22,286 ERROR [STDERR] at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:644)
      16:20:22,287 ERROR [STDERR] at org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:1054)
      16:20:22,287 ERROR [STDERR] at org.apache.jackrabbit.core.state.XAItemStateManager.prepare(XAItemStateManager.java:149)
      16:20:22,287 ERROR [STDERR] ... 37 more

        Attachments

        1. item-state-ear-SNAPSHOT.ear
          1.38 MB
          Moritz Rebbert
        2. ItemTestBean.java
          4 kB
          Moritz Rebbert
        3. Main.java
          0.5 kB
          Moritz Rebbert

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rebbert Moritz Rebbert
              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: