On Mar 12, 2008, at 5:21 AM, sdumitriu (SVN) wrote:
Author: sdumitriu Date: 2008-03-12 05:21:37 +0100 (Wed, 12 Mar 2008) New Revision: 8424
Modified: xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ plugin/packaging/Package.java Log: XWIKI-2200: Import of "homemade" xar doesn't function Fixed.
Modified: xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/ xwiki/plugin/packaging/Package.java =================================================================== --- xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ plugin/packaging/Package.java 2008-03-12 03:55:35 UTC (rev 8423) +++ xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ plugin/packaging/Package.java 2008-03-12 04:21:37 UTC (rev 8424) @@ -385,8 +385,14 @@ || (entry.getName().indexOf("META-INF") != -1)) { continue; } else { - XWikiDocument doc = - readFromXML(readByteArrayFromInputStream(zis, entry.getSize())); + XWikiDocument doc = null; + try { + doc = readFromXML(readByteArrayFromInputStream(zis, entry.getSize())); + } catch (Exception ex) { + log.warn("Failed to parse document [" + entry.getName() + "] from XML");
We need to also add ex.getMesage() to the log output in order to better diagnose errors when they appear. Also the message need to be more explicit. We need to say that we're ignoring the doc and that it won't be imported. Thanks -Vincent