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.