You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Manuel Simoni <ma...@systemone.at> on 2006/03/21 15:42:42 UTC

IllegalNameException when importing document view with two mixins

Hi,

I have nodes with two mixin types, s1NT:comment and s1NT:authored.

I am exporting the document view:

session.exportDocumentView(session.getRootNode().getPath(), 
outputStream, false, false);

When I try to import the document again:

session.getWorkspace().importXML(session.getRootNode().getPath(), 
inputStream, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);

...I get this exception:

java.lang.Exception: javax.jcr.InvalidSerializedDataException: failed to 
parse XML stream: illegal jcr:mixinTypes value: s1NT:comment 
s1NT:authored: illegal jcr:mixinTypes value: s1NT:comment s1NT:authored
	at 
at.systemone.wiki.webservice.ImportControllerImpl.importDocumentView(ImportControllerImpl.java:30)
	at 
at.systemone.wiki.webservice.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.InvalidSerializedDataException: failed to parse XML 
stream: illegal jcr:mixinTypes value: s1NT:comment s1NT:authored: 
illegal jcr:mixinTypes value: s1NT:comment s1NT:authored
	at 
org.apache.jackrabbit.core.WorkspaceImpl.importXML(WorkspaceImpl.java:718)
	at 
at.systemone.wiki.webservice.ImportControllerImpl.importDocumentView(ImportControllerImpl.java:27)
	... 16 more
Caused by: org.apache.jackrabbit.name.IllegalNameException: 
's1NT:comment s1NT:authored' is not a valid name
	at 
org.apache.jackrabbit.core.xml.DocViewImportHandler.startElement(DocViewImportHandler.java:217)
	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.WorkspaceImpl.importXML(WorkspaceImpl.java:709)
	... 17 more

I think the importer chokes on this node (it is the first node with 
these two mixin types in the XML file):

<s1:comment jcr:primaryType="s1NT:page" jcr:mixinTypes="s1NT:comment 
s1NT:authored" jcr:uuid="3ff1022b-3e21-4e44-9a2e-ae3b67e833e5" 
jcr:isCheckedOut="true" 
jcr:versionHistory="17186f20-dab2-42d8-8f66-0895472debea" 
jcr:frozenMixinTypes="s1NT:comment s1NT:authored" 
jcr:frozenUuid="3ff1022b-3e21-4e44-9a2e-ae3b67e833e5" 
s1:author="8db75ec7-eee8-44d8-aeb2-fbd116ea7e01" s1:title="" 
jcr:predecessors="fb9eefb2-e2f8-414c-be94-185111a89be9" 
s1:creationDate="2005-09-07T17:59:12.589Z" 
s1:editor="7b778c51-d8d8-474b-a621-f5759fc24cd0" s1:orphanedPage="false" 
s1:modificationDate="2006-03-18T17:55:49.838Z" s1:lowercaseTitle="" 
jcr:baseVersion="fb9eefb2-e2f8-414c-be94-185111a89be9" 
s1:currentEditor="8db75ec7-eee8-44d8-aeb2-fbd116ea7e01" 
jcr:frozenPrimaryType="s1NT:page">

Any ideas?

Manuel



Re: IllegalNameException when importing document view with two mixins

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 3/21/06, Manuel Simoni <ma...@systemone.at> wrote:
> java.lang.Exception: javax.jcr.InvalidSerializedDataException: failed to
> parse XML stream: illegal jcr:mixinTypes value: s1NT:comment
> s1NT:authored: illegal jcr:mixinTypes value: s1NT:comment s1NT:authored

This is related to JCR-325, the current document view importer doesn't
support multiple values in jcr:mixinTypes or any other property.
Please file a new bug report for this, I think there is an easy fix
for the jcr:mixinTypes special case that could be applied before the
JCR-325 issue is fully resolved.

BR,

Jukka Zitting

--
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development