hi manuel,
importing nodes below the jcr:system is not possible, since it's protected.
i strongly suggest to create a 'root' for your application, for
example: "jcr:content"
or "my:root" or something. then you can export/import all your data easily.

regards, toby

On 3/21/06, Manuel Simoni <[EMAIL PROTECTED]> wrote:
> I am trying to use the system view to export/import the repository contents.
>
> Export:
> session2.exportSystemView(session.getRootNode().getPath(), outputStream,
> false, false);
>
> When I import like this:
> session.importXML("/", inputStream,
> ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);
>
> I get the following exception:
>
> java.lang.Exception: javax.jcr.nodetype.ConstraintViolationException:
> /jcr:root/jcr:system/jcr:versionStorage: cannot add a child to a
> protected node
>         at ImportControllerImpl.import(ImportControllerImpl.java:30)
>         at ImportControllerTest.testImport(ImportControllerTest.java:12)
>         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:585)
>         at junit.framework.TestCase.runTest(TestCase.java:154)
>         at junit.framework.TestCase.runBare(TestCase.java:127)
>         at junit.framework.TestResult$1.protect(TestResult.java:106)
>         at junit.framework.TestResult.runProtected(TestResult.java:124)
>         at junit.framework.TestResult.run(TestResult.java:109)
>         at junit.framework.TestCase.run(TestCase.java:118)
>         at junit.framework.TestSuite.runTest(TestSuite.java:208)
>         at junit.framework.TestSuite.run(TestSuite.java:203)
>         at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
>         at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
>         at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: javax.jcr.nodetype.ConstraintViolationException:
> /jcr:root/jcr:system/jcr:versionStorage: cannot add a child to a
> protected node
>         at
> org.apache.jackrabbit.core.NodeImpl.internalAddChildNode(NodeImpl.java:779)
>         at org.apache.jackrabbit.core.NodeImpl.addNode(NodeImpl.java:1510)
>         at
> org.apache.jackrabbit.core.xml.SessionImporter.createNode(SessionImporter.java:124)
>         at
> org.apache.jackrabbit.core.xml.SessionImporter.startNode(SessionImporter.java:242)
>         at
> org.apache.jackrabbit.core.xml.SysViewImportHandler.processNode(SysViewImportHandler.java:82)
>         at
> org.apache.jackrabbit.core.xml.SysViewImportHandler.startElement(SysViewImportHandler.java:137)
>         at
> org.apache.jackrabbit.core.xml.ImportHandler.startElement(ImportHandler.java:234)
>         at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
> Source)
>         at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>
> Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at 
> org.apache.jackrabbit.core.SessionImpl.importXML(SessionImpl.java:1020)
>         at ImportControllerImpl.import(ImportControllerImpl.java:27)
>         ... 16 more
>
> Manuel
>
> [I've erroneously posted this to dev@jackrabbit.apache.org, which
> replied with an error, so I'm posting it here again.]
>
>


--
-----------------------------------------< [EMAIL PROTECTED] >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Reply via email to