jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <stefan.guggisb...@gmail.com>
Subject Re: child node definition found for {}importxml
Date Mon, 26 Jan 2009 08:35:28 GMT
On Mon, Jan 26, 2009 at 9:20 AM, Christofer Dutz <c.dutz@upw.de> wrote:
> Hi,
>
> thanks fort hat info. Unfortunately when using the file type, I get
> different errors:

who said you should use nt:file? i suggested using nt:unstructured...

cheers
stefan

>
> javax.jcr.nodetype.ConstraintViolationException: no definition found in
> parent node's node type for new node: no matching child node definition
> found for
> {http://oval.mitre.org/XMLSchema/oval-definitions-5}oval_definitions: no
> matching child node definition found for
> {http://oval.mitre.org/XMLSchema/oval-definitions-5}oval_definitions
>
> The documents I am storing has a root element called oval_definition ...
> unfortunately file-type seems to expect a content element. Is there a way to
> avoid wrapping everything in a content element?
>
>
> Chris
>
>
>
>
> -----Urspr√ľngliche Nachricht-----
> Von: Stefan Guggisberg [mailto:stefan.guggisberg@gmail.com]
> Gesendet: Freitag, 23. Januar 2009 21:50
> An: users@jackrabbit.apache.org
> Betreff: Re: child node definition found for {}importxml
>
> hi chris
>
> On Fri, Jan 23, 2009 at 7:05 PM, Christofer Dutz <c.dutz@upw.de> wrote:
>> Hi,
>>
>>
>>
>> Yesterday I started playing around with jackrabbit. In the meanwhile i
> think
>> I have a lot of stuff worked out. Unfortunately I am missing one thing
> form
>> y prototype to work:
>>
>>
>>
>> I want to create the folowing structure:
>>
>>
>>
>> /definitions/{definition-documents}
>>
>>
>>
>> I managed to get the Xml Import working using the sessions
>> getImportContentHandler method and quite some registerNamespace calls.
>>
>> Unfortunately this only seems to work when saving to direct children of my
>> repository. As soon as I create a folder using
>> "rootNode.addNode("definitions", "nt:folder");" I get the following
>> stacktrace: (adding my xml content to a node called "/documents/importxml"
>
> the node type nt:folder only allows child nodes of type nt:hierarchyNode,
> i.e. nt:folder and nt:file. it is used to model file system like
> hierarchies.
>
> what you want to use is nt:unstructured, which allows child nodes of any
> type.
>
> rootNode.addNode("definitions", "nt:folder");
>
> or
>
> rootNode.addNode("definitions");
>
> (nt:unstructured is the default).
>
> see e.g.
>
> rootNode.addNode("definitions", "nt:folder");
>
> for a description of some built-in used node types,
> see e.g.
>
> http://wiki.apache.org/jackrabbit/NodeTypeRegistry
>
> cheers
> stefan
>
>>
>>
>>
>> javax.jcr.nodetype.ConstraintViolationException: no definition found in
>> parent node's node type for new node: no matching child node definition
>> found for {}importxml: no matching child node definition found for
>> {}importxml
>>
>>      at
>>
> org.apache.jackrabbit.core.NodeImpl.internalAddChildNode(NodeImpl.java:763)
>>
>>      at
>> org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:729)
>>
>>      at
>> org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:677)
>>
>>      at org.apache.jackrabbit.core.NodeImpl.addNode(NodeImpl.java:2110)
>>
>>      at
>>
> de.upw.tiller.pgm.persistence.jackrabbit.JackrabbitPersistenceManager.addDef
>> initions(JackrabbitPersistenceManager.java:264)
>>
>>      at
>>
> de.upw.tiller.pgm.persistence.jackrabbit.JackrabbitPersistenceManagerTest.ad
>> dDefintionsTest(JackrabbitPersistenceManagerTest.java:85)
>>
>>      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>>      at
>>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
>> )
>>
>>      at
>>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
>> .java:25)
>>
>>      at java.lang.reflect.Method.invoke(Method.java:597)
>>
>>      at
>>
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.
>> java:44)
>>
>>      at
>>
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.j
>> ava:15)
>>
>>      at
>>
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.ja
>> va:41)
>>
>>      at
>>
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.jav
>> a:20)
>>
>>      at
>>
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28
>> )
>>
>>      at
>>
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>>
>>      at
>>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
>> a:73)
>>
>>      at
>>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
>> a:46)
>>
>>      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
>>
>>      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
>>
>>      at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
>>
>>      at
>>
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28
>> )
>>
>>      at
>>
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>>
>>      at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestRef
>> erence.java:45)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:3
>> 8)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
>> nner.java:460)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
>> nner.java:673)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
>> java:386)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
>> .java:196)
>>
>> Caused by: javax.jcr.nodetype.ConstraintViolationException: no matching
>> child node definition found for {}importxml
>>
>>      at
>>
> org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicableChildNode
>> Def(EffectiveNodeType.java:730)
>>
>>      at
>>
> org.apache.jackrabbit.core.NodeImpl.getApplicableChildNodeDefinition(NodeImp
>> l.java:873)
>>
>>      at
>>
> org.apache.jackrabbit.core.NodeImpl.internalAddChildNode(NodeImpl.java:759)
>>
>>      ... 29 more
>>
>> javax.jcr.nodetype.ConstraintViolationException: no matching child node
>> definition found for {}importxml
>>
>>      at
>>
> org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicableChildNode
>> Def(EffectiveNodeType.java:730)
>>
>>      at
>>
> org.apache.jackrabbit.core.NodeImpl.getApplicableChildNodeDefinition(NodeImp
>> l.java:873)
>>
>>      at
>>
> org.apache.jackrabbit.core.NodeImpl.internalAddChildNode(NodeImpl.java:759)
>>
>>      at
>> org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:729)
>>
>>      at
>> org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:677)
>>
>>      at org.apache.jackrabbit.core.NodeImpl.addNode(NodeImpl.java:2110)
>>
>>      at
>>
> de.upw.tiller.pgm.persistence.jackrabbit.JackrabbitPersistenceManager.addDef
>> initions(JackrabbitPersistenceManager.java:264)
>>
>>      at
>>
> de.upw.tiller.pgm.persistence.jackrabbit.JackrabbitPersistenceManagerTest.ad
>> dDefintionsTest(JackrabbitPersistenceManagerTest.java:85)
>>
>>      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>>      at
>>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
>> )
>>
>>      at
>>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
>> .java:25)
>>
>>      at java.lang.reflect.Method.invoke(Method.java:597)
>>
>>      at
>>
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.
>> java:44)
>>
>>      at
>>
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.j
>> ava:15)
>>
>>      at
>>
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.ja
>> va:41)
>>
>>      at
>>
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.jav
>> a:20)
>>
>>      at
>>
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28
>> )
>>
>>      at
>>
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>>
>>      at
>>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
>> a:73)
>>
>>      at
>>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
>> a:46)
>>
>>      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
>>
>>      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
>>
>>      at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
>>
>>      at
>>
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28
>> )
>>
>>      at
>>
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>>
>>      at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestRef
>> erence.java:45)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:3
>> 8)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
>> nner.java:460)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
>> nner.java:673)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
>> java:386)
>>
>>      at
>>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
>> .java:196)
>>
>>
>>
>> I created the doczuments node using the following code:
>>
>>
>>
>> rootNode.addNode("definitions", "nt:folder");
>>
>>
>>
>> I think my problem must be some really simple problem. Unfortunately I
> have
>> tried figuring this out with google for quite some time now.
>>
>>
>>
>> Chris
>>
>>
>>
>>
>>
>>
>
>

Mime
View raw message