You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2009/11/03 21:17:32 UTC

[jira] Resolved: (JCR-2145) Exception: "javax.jcr.InvalidItemStateException:Item cannot be saved because it has beenmodified externally: node /" while saving in repository

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

Jukka Zitting resolved JCR-2145.
--------------------------------

    Resolution: Invalid
      Assignee: Jukka Zitting

The InvalidItemStateException already states what the problem is. Your save() call happened conflict with another save, and the repository was unable to automatically merge the changes. This is expected behaviour. You can prevent such cases by explicitly serializing any such conflicting changes with a JCR lock or some other synchronization mechanism.

> Exception: "javax.jcr.InvalidItemStateException:Item cannot be saved because it has beenmodified externally: node /" while saving in repository
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-2145
>                 URL: https://issues.apache.org/jira/browse/JCR-2145
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>         Environment: Solaris OS, JDK 1.5
>            Reporter: Ritesh Chauhan
>            Assignee: Jukka Zitting
>
> My code is running in Production for past 3 months but today I  got this InvalidItemStateException while saving as pdf file in the repository (Log attached below). 
> Though, my document got saved in the repository, but still the exception came. 
> Not sure whether this happened because of concorrent sessions, i need to know the reason for this exception so that we can avoid this to happen in future and avoid probable loss of Document.
> Here's the error:
> gov.ms.mdes.access.framework.exception.BaseRunTimeException: null
>  Inner Exception :javax.jcr.InvalidItemStateException:Item cannot be saved because it has beenmodified externally: node /
>         at gov.ms.mdes.access.framework.exception.BaseRunTimeException.wrapAndThrow(BaseRunTimeException.java:138)
>         at gov.ms.mdes.access.framework.dms.DmsDataTemplate.save(DmsDataTemplate.java:81)
>         at gov.ms.mdes.access.framework.dms.BaseDmsDAO.save(BaseDmsDAO.java:40)
>         at gov.ms.mdes.access.batch.op.BatchRepaymentDistributionBalancingReport.performBusinessProcess(BatchRepaymentDistributionBalancingReport.java:75)
>         at gov.ms.mdes.access.batch.framework.BatchManager.runBatch(BatchManager.java:219)
>         at gov.ms.mdes.access.batch.framework.scheduling.impl.quartz.job.CustomJob.executeBatch(CustomJob.java:83)
>         at gov.ms.mdes.access.batch.framework.scheduling.impl.quartz.job.CustomJob.access$000(CustomJob.java:25)
>         at gov.ms.mdes.access.batch.framework.scheduling.impl.quartz.job.CustomJob$BatchThread.run(CustomJob.java:160)
> Caused by: javax.jcr.InvalidItemStateException: Item cannot be saved because it has beenmodified externally: node /
>         at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:104)
>         at org.apache.jackrabbit.rmi.server.ServerSession.save(ServerSession.java:212)
>         at sun.reflect.GeneratedMethodAccessor5639.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
>         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
>         at java.lang.Thread.run(Thread.java:595)
>         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
>         at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
>         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
>         at org.apache.jackrabbit.rmi.server.ServerXASession_Stub.save(Unknown Source)
>         at org.apache.jackrabbit.rmi.client.ClientSession.save(ClientSession.java:208)
>         at gov.ms.mdes.access.framework.dms.DmsDataTemplate.save(DmsDataTemplate.java:77)
>         ... 6 more
>  
> Inner Exception: 
> javax.jcr.InvalidItemStateException: Item cannot be saved because it has beenmodified externally: node /
>         at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:104)
>         at org.apache.jackrabbit.rmi.server.ServerSession.save(ServerSession.java:212)
>         at sun.reflect.GeneratedMethodAccessor5639.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
>         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
>         at java.lang.Thread.run(Thread.java:595)
>         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
>         at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
>         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
>         at org.apache.jackrabbit.rmi.server.ServerXASession_Stub.save(Unknown Source)
>         at org.apache.jackrabbit.rmi.client.ClientSession.save(ClientSession.java:208)
>         at gov.ms.mdes.access.framework.dms.DmsDataTemplate.save(DmsDataTemplate.java:77)
>         at gov.ms.mdes.access.framework.dms.BaseDmsDAO.save(BaseDmsDAO.java:40)
>         at gov.ms.mdes.access.batch.op.BatchRepaymentDistributionBalancingReport.performBusinessProcess(BatchRepaymentDistributionBalancingReport.java:75)
>         at gov.ms.mdes.access.batch.framework.BatchManager.runBatch(BatchManager.java:219)
>         at gov.ms.mdes.access.batch.framework.scheduling.impl.quartz.job.CustomJob.executeBatch(CustomJob.java:83)
>         at gov.ms.mdes.access.batch.framework.scheduling.impl.quartz.job.CustomJob.access$000(CustomJob.java:25)
>         at gov.ms.mdes.access.batch.framework.scheduling.impl.quartz.job.CustomJob$BatchThread.run(CustomJob.java:160)

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