You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Siegfried Puchbauer <si...@gmail.com> on 2009/02/05 20:01:18 UTC
SAX Namespace problem when importing previously exported XML
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/
Re: SAX Namespace problem when importing previously exported XML
Posted by Stefan Guggisberg <st...@gmail.com>.
On Fri, Feb 20, 2009 at 4:10 PM, Moritz Rebbert <mo...@udo.edu> wrote:
> Hi,
> On Fri, Feb 06, 2009 at 12:22:27PM +0100, Stefan Guggisberg wrote:
>> On Fri, Feb 6, 2009 at 12:07 PM, Jukka Zitting <ju...@gmail.com> wrote:
>> >> The export*View methods seem to faulty print out the namespace declarations
>> >> twice:
>> >> [...]
>> >> Is anyone else experiencing such a problem? Why does it happen? Is there a
>> >> workaround?
>> >
>> > Some earlier JAXP implementations didn't print out any namespace
>> > declarations, so we have special code in Jackrabbit that explicitly
>> > adds the missing xmlns attributes when needed. Apparently in your case
>> > this logic gets broken and you end up with duplicate namespaces.
>> >
>> > The relevant code in Jackrabbit is located in the
>> > org.apache.jackrabbit.commons.xml package in the
>> > jackrabbit-jcr-commons component. It would be helpful if you could
>> > file a bug report about this in the issue tracker.
>>
>> please provide detailed information about your environment (os, appserver,
>> jre, etc). i quickly tested with jackrabbit trunk standalone on os-x 1.5.6
>> but was unable to reproduce the issue.
>
> I noticed the same problem,
>
> is there a bug report in the issue tracker, yet?
http://issues.apache.org/jira/browse/JCR-1952
cheers
stefan
>
> My environment is:
> jackrabbit-1.5.0.rar
> jboss-5.0.0.GA
>
> I use:
> Session.exportSystemView(String,__OutputStream__,boolean,boolean)
> and the corresponding import-method.
>
> Im not sure how to configure which JAXP implementation is used. Doesn't
> it depend on the jackrabbit dependency or is it part of the jdk or the
> jboss?
>
> Regards
> Moritz
>
Re: SAX Namespace problem when importing previously exported XML
Posted by Moritz Rebbert <mo...@udo.edu>.
Hi,
On Fri, Feb 06, 2009 at 12:22:27PM +0100, Stefan Guggisberg wrote:
> On Fri, Feb 6, 2009 at 12:07 PM, Jukka Zitting <ju...@gmail.com> wrote:
> >> The export*View methods seem to faulty print out the namespace declarations
> >> twice:
> >> [...]
> >> Is anyone else experiencing such a problem? Why does it happen? Is there a
> >> workaround?
> >
> > Some earlier JAXP implementations didn't print out any namespace
> > declarations, so we have special code in Jackrabbit that explicitly
> > adds the missing xmlns attributes when needed. Apparently in your case
> > this logic gets broken and you end up with duplicate namespaces.
> >
> > The relevant code in Jackrabbit is located in the
> > org.apache.jackrabbit.commons.xml package in the
> > jackrabbit-jcr-commons component. It would be helpful if you could
> > file a bug report about this in the issue tracker.
>
> please provide detailed information about your environment (os, appserver,
> jre, etc). i quickly tested with jackrabbit trunk standalone on os-x 1.5.6
> but was unable to reproduce the issue.
I noticed the same problem,
is there a bug report in the issue tracker, yet?
My environment is:
jackrabbit-1.5.0.rar
jboss-5.0.0.GA
I use:
Session.exportSystemView(String,__OutputStream__,boolean,boolean)
and the corresponding import-method.
Im not sure how to configure which JAXP implementation is used. Doesn't
it depend on the jackrabbit dependency or is it part of the jdk or the
jboss?
Regards
Moritz
Re: SAX Namespace problem when importing previously exported XML
Posted by Stefan Guggisberg <st...@gmail.com>.
On Fri, Feb 6, 2009 at 12:07 PM, Jukka Zitting <ju...@gmail.com> wrote:
> Hi,
>
> On Thu, Feb 5, 2009 at 8:01 PM, Siegfried Puchbauer
> <si...@gmail.com> wrote:
>> The export*View methods seem to faulty print out the namespace declarations
>> twice:
>> [...]
>> Is anyone else experiencing such a problem? Why does it happen? Is there a
>> workaround?
>
> Some earlier JAXP implementations didn't print out any namespace
> declarations, so we have special code in Jackrabbit that explicitly
> adds the missing xmlns attributes when needed. Apparently in your case
> this logic gets broken and you end up with duplicate namespaces.
>
> The relevant code in Jackrabbit is located in the
> org.apache.jackrabbit.commons.xml package in the
> jackrabbit-jcr-commons component. It would be helpful if you could
> file a bug report about this in the issue tracker.
please provide detailed information about your environment (os, appserver,
jre, etc). i quickly tested with jackrabbit trunk standalone on os-x 1.5.6
but was unable to reproduce the issue.
cheers
stefan
>
> BR,
>
> Jukka Zitting
>
Re: SAX Namespace problem when importing previously exported XML
Posted by Jukka Zitting <ju...@gmail.com>.
Hi,
On Thu, Feb 5, 2009 at 8:01 PM, Siegfried Puchbauer
<si...@gmail.com> wrote:
> The export*View methods seem to faulty print out the namespace declarations
> twice:
> [...]
> Is anyone else experiencing such a problem? Why does it happen? Is there a
> workaround?
Some earlier JAXP implementations didn't print out any namespace
declarations, so we have special code in Jackrabbit that explicitly
adds the missing xmlns attributes when needed. Apparently in your case
this logic gets broken and you end up with duplicate namespaces.
The relevant code in Jackrabbit is located in the
org.apache.jackrabbit.commons.xml package in the
jackrabbit-jcr-commons component. It would be helpful if you could
file a bug report about this in the issue tracker.
BR,
Jukka Zitting