jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reetesh chauhan <chauhan.reet...@gmail.com>
Subject Re: Exception while saving in repository: "javax.jcr.InvalidItemStateException:Item cannot be saved because it has beenmodified externally: node /"
Date Fri, 12 Jun 2009 16:03:18 GMT
Thanks Lan for your reply.
I also think it is the 2 sessions concurrently modifying the same property
thats causing the problem.

But The document i am trying to save is in "access/reports/<report name>"
node and the exception came for the root node.

Any idea why it would give this exception for the root node?


On Thu, Jun 11, 2009 at 3:38 PM, Ian Boston <ieb@tfd.co.uk> wrote:

> IIRC There are 2 causes for this, one common , one rare.
>
> The common one is 2 sessions concurrently modifying the same property on a
> node at the same time causing one of the nodes to fail to save the result.
> For example adding a value to a multi-valued property or frequently by
> adding one or more child nodes to the same parent node from multiple
> sessions.
>
> The rare situation, which can be caused by a poorly implemented
> AccessManager that modifies the state of the item cache whilst check for a
> permission. If you havent done anything complex in a custom access manager,
> then it wont be this one.
>
>
> Looking at your stack trace I am going to guess its the former. Looks like
> you might be modifying something on / which has a high probability of
> producing an unmergable modification with another session.
>
> HTH
> Ian
>
>
> On 11 Jun 2009, at 16:39, reetesh chauhan wrote:
>
>  Hi,
>> We are using Jackrabbit 1.5.0 with Solaris OS, JDK 1.5 environment.
>> 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 or what, 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.
>>
>> Any one having any suggestions on this please?
>>
>>
>> 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)
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message