javax.jcr.InvalidItemStateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • After metadata has already been updated by another thread which removed and added it (xmlImport), the remove by a thread waiting on the lock (inside its own tx) fails because the original item no longer exists. Need to re-read the new value before deleting it to refresh the state? org.springframework.transaction.TransactionSystemException: Could not commit JCR transaction; nested exception is javax.transaction.RollbackException: javax.transaction.xa.XAException at org.springmodules.jcr.jackrabbit.LocalTransactionManager.doCommit(LocalTransactionManager.java:195) at org.artifactory.jcr.JcrTransactionManager.doCommit(JcrTransactionManager.java:85) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635) at org.artifactory.repo.service.RepositoryServiceImpl$$EnhancerByCGLIB$$79b65f35.getResourceStreamHandle(<generated>) at org.artifactory.engine.DownloadEngine.respond(DownloadEngine.java:509) at org.artifactory.engine.DownloadEngine.processStandard(DownloadEngine.java:195) at org.artifactory.engine.DownloadEngine.process(DownloadEngine.java:115) at org.artifactory.test.SimpleArtifactoryTest.simpleJarDownload(SimpleArtifactoryTest.java:31) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) Caused by: javax.transaction.RollbackException: javax.transaction.xa.XAException at org.springmodules.jcr.jackrabbit.support.JackRabbitUserTransaction.commit(JackRabbitUserTransaction.java:111) at org.springmodules.jcr.jackrabbit.LocalTransactionManager.doCommit(LocalTransactionManager.java:192) ... 26 more Caused by: javax.transaction.xa.XAException at org.apache.jackrabbit.core.TransactionContext.prepare(TransactionContext.java:155) at org.apache.jackrabbit.core.XASessionImpl.prepare(XASessionImpl.java:324) at org.springmodules.jcr.jackrabbit.support.JackRabbitUserTransaction.commit(JackRabbitUserTransaction.java:101) ... 27 more Caused by: org.apache.jackrabbit.core.TransactionException: Unable to prepare transaction. at org.apache.jackrabbit.core.state.XAItemStateManager.prepare(XAItemStateManager.java:152) at org.apache.jackrabbit.core.TransactionContext.prepare(TransactionContext.java:138) ... 29 more Caused by: org.apache.jackrabbit.core.state.StaleItemStateException: 46254760-0ca4-4cf2-ae4c-3560e4e97d9e/{http://www.jcp.org/jcr/1.0}mimeType has been modified externally at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:620) at org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:843) at org.apache.jackrabbit.core.state.XAItemStateManager.prepare(XAItemStateManager.java:146) ... 30 more ... Removed 11 stack frames
    via by Yoav Landman,
  • After metadata has already been updated by another thread which removed and added it (xmlImport), the remove by a thread waiting on the lock (inside its own tx) fails because the original item no longer exists. Need to re-read the new value before deleting it to refresh the state? org.springframework.transaction.TransactionSystemException: Could not commit JCR transaction; nested exception is javax.transaction.RollbackException: javax.transaction.xa.XAException at org.springmodules.jcr.jackrabbit.LocalTransactionManager.doCommit(LocalTransactionManager.java:195) at org.artifactory.jcr.JcrTransactionManager.doCommit(JcrTransactionManager.java:85) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635) at org.artifactory.repo.service.RepositoryServiceImpl$$EnhancerByCGLIB$$79b65f35.getResourceStreamHandle(<generated>) at org.artifactory.engine.DownloadEngine.respond(DownloadEngine.java:509) at org.artifactory.engine.DownloadEngine.processStandard(DownloadEngine.java:195) at org.artifactory.engine.DownloadEngine.process(DownloadEngine.java:115) at org.artifactory.test.SimpleArtifactoryTest.simpleJarDownload(SimpleArtifactoryTest.java:31) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) Caused by: javax.transaction.RollbackException: javax.transaction.xa.XAException at org.springmodules.jcr.jackrabbit.support.JackRabbitUserTransaction.commit(JackRabbitUserTransaction.java:111) at org.springmodules.jcr.jackrabbit.LocalTransactionManager.doCommit(LocalTransactionManager.java:192) ... 26 more Caused by: javax.transaction.xa.XAException at org.apache.jackrabbit.core.TransactionContext.prepare(TransactionContext.java:155) at org.apache.jackrabbit.core.XASessionImpl.prepare(XASessionImpl.java:324) at org.springmodules.jcr.jackrabbit.support.JackRabbitUserTransaction.commit(JackRabbitUserTransaction.java:101) ... 27 more Caused by: org.apache.jackrabbit.core.TransactionException: Unable to prepare transaction. at org.apache.jackrabbit.core.state.XAItemStateManager.prepare(XAItemStateManager.java:152) at org.apache.jackrabbit.core.TransactionContext.prepare(TransactionContext.java:138) ... 29 more Caused by: org.apache.jackrabbit.core.state.StaleItemStateException: 46254760-0ca4-4cf2-ae4c-3560e4e97d9e/{http://www.jcp.org/jcr/1.0}mimeType has been modified externally at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:620) at org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:843) at org.apache.jackrabbit.core.state.XAItemStateManager.prepare(XAItemStateManager.java:146) ... 30 more ... Removed 11 stack frames
    via by Yoav Landman,
    • javax.jcr.InvalidItemStateException: Unable to update a stale item: item.save() at org.apache.jackrabbit.core.ItemSaveOperation.perform(ItemSaveOperation.java:262) at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216) at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91) at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:329) at org.apache.jackrabbit.core.session.SessionSaveOperation.perform(SessionSaveOperation.java:65) at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216) at org.apache.jackrabbit.core.SessionImpl.perform(SessionImpl.java:361) at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:812) at com.day.crx.core.CRXSessionImpl.save(CRXSessionImpl.java:142) at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.commit(JcrResourceProvider.java:511) Caused by: org.apache.jackrabbit.core.state.StaleItemStateException: 3bec1cb7-9276-4bed-a24e-0f41bb3cf5b7/{}ssn has been modified externally at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:679) at org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:1507) at org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:1537) at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:400) at org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:354) at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:375) at org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:275) at org.apache.jackrabbit.core.ItemSaveOperation.perform(ItemSaveOperation.java:258)
    No Bugmate found.