jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Siegfried Puchbauer <siegfried.puchba...@gmail.com>
Subject SAX Namespace problem when importing previously exported XML
Date Thu, 05 Feb 2009 19:01:18 GMT
Hi guys,

I have a problem regarding the JCR import/export functionality in jackrabbit
(1.5.2):

When I create a backup (using session.exportSystemView or
session.exportDocumentView) and later import that generated XML using
session.importXML or worspace.importXML it fails with the an exception with
the following root cause:

<snip>
Caused by: org.xml.sax.SAXParseException: Attribute "fn" bound to namespace
"http://www.w3.org/2000/xmlns/" was already specified for element "sv:node".
    at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
    at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    at
org.apache.jackrabbit.commons.xml.ParsingContentHandler.parse(ParsingContentHandler.java:62)
    at
org.apache.jackrabbit.commons.AbstractWorkspace.importXML(AbstractWorkspace.java:54)
</snip>

The export*View methods seem to faulty print out the namespace declarations
twice:

<?xml version="1.0" encoding="UTF-8"?><sv:node *xmlns:fn="
http://www.w3.org/2005/xpath-functions" xmlns:fn_old="
http://www.w3.org/2004/10/xpath-functions" xmlns:dts="http://www.foo.com/dts"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jcr="
http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal" xmlns:nt="
http://www.jcp.org/jcr/nt/1.0" sv:name="jcr:root"* xmlns:fn="
http://www.w3.org/2005/xpath-functions" xmlns:fn_old="
http://www.w3.org/2004/10/xpath-functions" xmlns:dts="http://www.foo.com/dts"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jcr="
http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal" xmlns:nt="
http://www.jcp.org/jcr/nt/1.0">[...]

Btw. I'm using the Xerces version 2.6.2 which is built into the JDK (on mac
os x) and so it is not swapable.

Is anyone else experiencing such a problem? Why does it happen? Is there a
workaround?

Any help appreciated!

Cheers, Sigi
_______________________
Siegfried Puchbauer
http://siegfried.puchbauer.com/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message