After discussing with Michael Durig created OAK-943 [1] and provided a patch to improve the message.
[1] https://issues.apache.org/jira/browse/OAK-943 Chetan Mehrotra On Thu, Aug 1, 2013 at 7:28 PM, Chetan Mehrotra <chetan.mehro...@gmail.com> wrote: > In one of the test scenario I am getting CommitFailedException [0] [1] > . From just looking at the exception its hard to make out the root > cause. I was able to get the actual conflict details only by debugging > and accessing runtime state which is like > > [ > { > ":conflict": { > "deleteChangedNode": { > "parentFolder": "{N\/A}" > } > } > }, > { > "rep:ours": { > "deleteChanged": { > "parentFolder": "{N\/A}" > } > } > } > ] > > If this conflict information can be made available as part of > exception then it would simplify debugging. Looking at the code > ConflictValidator does not have access to the parent node which > contains the 'conflict' and 'rep:ours' nodes. Probably that data can > be collected at > org.apache.jackrabbit.oak.spi.commit.EditorDiff#process method as at > that level we can access the other sibling nodes (sibling to > jcr:mixinTypes property). I can create a patch .... but not sure at > what level and how to propogate the commit failed data. > > So how to debug CommitFailedException easily? > > Chetan Mehrotra > > [0] https://paste.apache.org/byc6 > [1] Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: > OakState0001: Unresolved conflicts in / > at > org.apache.jackrabbit.oak.plugins.commit.ConflictValidator.failOnMergeConflict(ConflictValidator.java:82) > at > org.apache.jackrabbit.oak.plugins.commit.ConflictValidator.propertyChanged(ConflictValidator.java:59) > at > org.apache.jackrabbit.oak.spi.commit.CompositeEditor.propertyChanged(CompositeEditor.java:91) > at > org.apache.jackrabbit.oak.spi.commit.EditorDiff.propertyChanged(EditorDiff.java:93) > at > org.apache.jackrabbit.oak.plugins.memory.ModifiedNodeState.compareAgainstBaseState(ModifiedNodeState.java:355) > at > org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:52) > at > org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:129) > at > org.apache.jackrabbit.oak.plugins.memory.ModifiedNodeState.compareAgainstBaseState(ModifiedNodeState.java:373) > at > org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:52) > at > org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:129) > at > org.apache.jackrabbit.oak.plugins.memory.ModifiedNodeState.compareAgainstBaseState(ModifiedNodeState.java:373) > at > org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:52) > at > org.apache.jackrabbit.oak.spi.commit.EditorHook.processCommit(EditorHook.java:50) > at > org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:59) > at > org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:59) > at > org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreBranch.optimisticMerge(SegmentNodeStoreBranch.java:110) > at > org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreBranch.merge(SegmentNodeStoreBranch.java:201) > at > org.apache.jackrabbit.oak.core.AbstractRoot$2.run(AbstractRoot.java:247) > at > org.apache.jackrabbit.oak.core.AbstractRoot$2.run(AbstractRoot.java:243) > at java.security.AccessController.doPrivileged(Native Method) > at javax.security.auth.Subject.doAs(Subject.java:337) > at > org.apache.jackrabbit.oak.core.AbstractRoot.commit(AbstractRoot.java:242) > at > org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:269)