Issue Details (XML | Word | Printable)

Key: JCR-369
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Jukka Zitting
Reporter: Jukka Zitting
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Jackrabbit Content Repository

IllegalNameException when importing document view with two mixins

Created: 23/Mar/06 08:10 AM   Updated: 13/Oct/06 04:08 PM
Return to search
Component/s: xml
Affects Version/s: 0.9, 1.0
Fix Version/s: 1.0.1

Time Tracking:
Not Specified

Issue Links:
Incorporates
 

Resolution Date: 01/Apr/06 10:55 PM


 Description  « Hide
As reported by Manuel Simoni on the dev mailing list:

----

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">

----

This issue is related to JCR-325, but there should be a lot easier fix for this special case.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.