You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by "Hatherly, Adam (GE Money)" <Ad...@ge.com> on 2007/06/28 14:00:45 UTC

Problems with importing binary repository contents on a Solaris box

Hi,

I have a web app that makes use of a Jackrabbit repository using a resource adapter in a J2EE environment. The app includes the ability to export and import repository contents using the session.exportSystemView and session.importXML methods.

The import and export work fine in my dev environment, which is (JBoss on Windows). It also works fine on one of my target environments (WebSphere on Linux), but when I try to import a file exported from one of these environments into my other target environment (Sun App Server 7 on Solaris 9), I get the below error:

javax.jcr.InvalidSerializedDataException: failed to parse XML stream: null: null
        at org.apache.jackrabbit.core.SessionImpl.importXML(SessionImpl.java:1125)
        at org.apache.jackrabbit.jca.JCASessionHandle.importXML(JCASessionHandle.java:229)
             -- snip --
Caused by: java.lang.ArrayIndexOutOfBoundsException
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1111)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)

If I import purely text nodes I don't have any problems, the above problem only occurs when I import content that contains binary data. I can only assume it is an encoding issue with the binary data?
Does anyone have any ideas what I am doing wrong?

The code I am using for the import is very simple:

FileInputStream xml = new FileInputStream(filename);
session.importXML("/", xml, ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
xml.close();
session.save();


Thanks,
Adam.


RE: Problems with importing binary repository contents on a Solaris box

Posted by "Hatherly, Adam (GE Money)" <Ad...@ge.com>.
That did the trick - thank you very much for the prompt response!

Adam.

-----Original Message-----
From: bdelacretaz@gmail.com [mailto:bdelacretaz@gmail.com]On Behalf Of
Bertrand Delacretaz
Sent: 28 June 2007 13:53
To: users@jackrabbit.apache.org
Subject: Re: Problems with importing binary repository contents on a
Solaris box


On 6/28/07, Hatherly, Adam (GE Money) <Ad...@ge.com> wrote:

> ...when I try to import a file exported from one of these environments into my other
> target environment (Sun App Server 7 on Solaris 9), I get the below error:...

> ...Caused by: java.lang.ArrayIndexOutOfBoundsException
>         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1111)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)...

This might indicate that a broken XML parser is present in your Java
environment.

I'd try putting a known good version of xerces in Java's lib/endorsed
directory before starting the app, to see if it makes a difference.

Jackrabbit currently uses the default XML parser provided by the
SAXParserFactory, so broken parsers found "early" in the classloading
chain can cause trouble.

FWIW, http://wiki.apache.org/cocoon/EndorsedLibsProblem describes a
similar problem that we had with Cocoon.

-Bertrand

Re: Problems with importing binary repository contents on a Solaris box

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 6/28/07, Hatherly, Adam (GE Money) <Ad...@ge.com> wrote:

> ...when I try to import a file exported from one of these environments into my other
> target environment (Sun App Server 7 on Solaris 9), I get the below error:...

> ...Caused by: java.lang.ArrayIndexOutOfBoundsException
>         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1111)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)...

This might indicate that a broken XML parser is present in your Java
environment.

I'd try putting a known good version of xerces in Java's lib/endorsed
directory before starting the app, to see if it makes a difference.

Jackrabbit currently uses the default XML parser provided by the
SAXParserFactory, so broken parsers found "early" in the classloading
chain can cause trouble.

FWIW, http://wiki.apache.org/cocoon/EndorsedLibsProblem describes a
similar problem that we had with Cocoon.

-Bertrand