[ https://issues.apache.org/jira/browse/OAK-8232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16815720#comment-16815720 ]
Manfred Baedke commented on OAK-8232: ------------------------------------- Test case fails with: {code:java} javax.jcr.nodetype.ConstraintViolationException: OakConstraint0025: /a[[rep:test]]: Mandatory child node mandatoryAutoCreated not found in a new node at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:226) at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:213) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.newRepositoryException(SessionDelegate.java:669) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:495) at org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.performVoid(SessionImpl.java:420) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:273) at org.apache.jackrabbit.oak.jcr.session.SessionImpl.save(SessionImpl.java:417) at org.apache.jackrabbit.oak.jcr.nodetype.NodeTypeTest.setPrimaryTypeWithMandatoryAutoCreatedChild(NodeTypeTest.java:108) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakConstraint0025: /a[[rep:test]]: Mandatory child node mandatoryAutoCreated not found in a new node at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor$1.onConstraintViolation(TypeEditor.java:109) at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.constraintViolation(TypeEditor.java:234) at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.checkNodeTypeConstraints(TypeEditor.java:473) at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.enter(TypeEditor.java:276) at org.apache.jackrabbit.oak.spi.commit.VisibleEditor.enter(VisibleEditor.java:53) at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.enter(CompositeEditor.java:65) at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:121) at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:505) at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:651) at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:51) at org.apache.jackrabbit.oak.spi.commit.EditorHook.processCommit(EditorHook.java:54) at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:60) at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:60) at org.apache.jackrabbit.oak.segment.scheduler.Commit.apply(Commit.java:99) at org.apache.jackrabbit.oak.segment.scheduler.LockBasedScheduler.execute(LockBasedScheduler.java:299) at org.apache.jackrabbit.oak.segment.scheduler.LockBasedScheduler.schedule(LockBasedScheduler.java:270) at org.apache.jackrabbit.oak.segment.SegmentNodeStore.merge(SegmentNodeStore.java:211) at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:251) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.commit(SessionDelegate.java:346) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:493) ... 31 more {code} > Node#setPrimaryType(String) does not create child nodes defined as autoCreated > ------------------------------------------------------------------------------ > > Key: OAK-8232 > URL: https://issues.apache.org/jira/browse/OAK-8232 > Project: Jackrabbit Oak > Issue Type: Bug > Components: jcr > Affects Versions: 1.12.0 > Reporter: Manfred Baedke > Priority: Minor > Attachments: oak-8232-testcase.patch > > > In contrast to Node#addNode(String, String), Node#setPrimaryType(String) does > not create child nodes that are defined as autoCreated. See attached failing > test case. -- This message was sent by Atlassian JIRA (v7.6.3#76005)