Modeshape 3.1.1 and federation
vasilievip Feb 5, 2013 8:28 AMI'm exploring federation in modeshape 3.x and cant get it working so far (see my fork from modeshape-examples here https://github.com/vasilievip/modeshape-examples/commits/federation2)
Here is the issue I see:
{code}
session = repository.login("default");
Node root = session.getRootNode();
Node fed = root.getNode("federation"); <-- Node under federation
Node folder = fed.addNode("Folder" + rnd.nextInt(), "nt:folder");
Node file = fed.addNode("File" + rnd.nextInt(), "nt:file");
session.save();
{code}
{code}
javax.jcr.nodetype.ConstraintViolationException: The values for the '{http://www.jcp.org/jcr/1.0}content' property on node '/federation/File1481898856' no longer satisfy the type and/or constraints on the 'jcr:content' property definition on the 'nt:file' node type definition
at org.modeshape.jcr.JcrSession$JcrPreSave.process(JcrSession.java:1811)
at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:501)
at org.modeshape.jcr.JcrSession.save(JcrSession.java:978)
at org.modeshape.example.filesystem.ModeShapeExample.main(ModeShapeExample.java:73)
at org.modeshape.example.embedded.ModeShapeExampleTest.shouldRunApplication(ModeShapeExampleTest.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
{code}
Please advise