Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7418

Import of .xar package from older xwiki fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 3.3
    • Administration
    • Linux, source instance: 3.0 on postgresql 8.4, destination instance: 3.3 on postgresql 9.1, tomcat 6.0, jdk 1.6
    • Unknown
    • N/A
    • N/A

    Description

      I have a .xar backup package of my whole wiki, created by xwiki 3.0 instance. After unsuccessfull upgrade (see XWIKI-7388) I decided to start with a fresh new database. I've created an empty database, launched a 3.3 xwiki instance pointing to it, imported my .xar to the wiki (filesystem based attachment store set in xwiki.cfg) - without problems.

      Now, when I try to display content of the uploaded package - I have an error (logs at the bottom). When i unzip the .xar file, remove from it documents with attachments (stored in documents) and create and upload .xar file again - I can display its contents without problems.

      My source xwiki installation was upgraded many times (it is a few years old), mostly without problems, attachments are working ok, but my source db schema differs from the schema created by 3.3 version. The column xwa_content of xwikiattachment_content table and xwa_archive of the xwikiattachment_archive tables are (in the source db) of type bytea; 3.3 version created them with type oid.

      How can I deal with this problem? Try to find a solution for manual DB migration?

      This is the exception i get in catalina.out:

      2012-01-19 20:18:56,170 [http://localhost:8080/xwiki/bin/get/XWiki/XWikiPreferences?xpage=packageinfo&package=backupprzedupgrade.xar] WARN  c.x.x.p.p.Package              - Failed to parse doc
      ument [XWiki/XWikiPreferences.xml] from XML during import, thus it will not be installed. The error was: null 
      org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [/templates/packageinfo.vm]
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:195)
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:152)
              at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:117)
              at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1813)
              at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:154)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:239)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:116)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
       [...]
      
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'toJSON' in  class com.xpn.xwiki.plugin.packaging.PackageAPI threw exception net.sf.json.JSONException: java.lang.NullPointerException: JSON keys must not be null nor the 'null' string. at /templates/packageinfo.vm[line 14, column 13]
              at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243)
              at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:187)
              at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
              at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
              at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
              at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
              at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
              at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
              at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
              at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:186)
              ... 39 more
      Caused by: net.sf.json.JSONException: java.lang.NullPointerException: JSON keys must not be null nor the 'null' string.
              at net.sf.json.JSONObject._fromMap(JSONObject.java:1357)
              at net.sf.json.JSONObject.fromObject(JSONObject.java:159)
              at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:265)
              at net.sf.json.JSONObject._processValue(JSONObject.java:2808)
              at net.sf.json.JSONObject.processValue(JSONObject.java:2874)
      [...]
      Caused by: java.lang.NullPointerException: JSON keys must not be null nor the 'null' string.
              at net.sf.json.JSONObject._fromMap(JSONObject.java:1321)
              ... 73 more
      org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [/templates/packageinfo.vm]
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:195)
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:152)
              at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:117)
              at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1813)
              at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:154)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:239)
      [...]
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'importPackageFromByteArray' in  class com.xpn.xwiki.plugin.packaging.PackageAPI threw exception java.lang.IllegalArgumentException at /templates/packageinfo.vm[line 13, column 24]
              at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243)
              at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:187)
              at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
              at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
              at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
              at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
              at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
              at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
              at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
              at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
              at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
              at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:186)
              ... 39 more
      Caused by: java.lang.IllegalArgumentException
              at java.util.zip.ZipInputStream.getUTF8String(ZipInputStream.java:303)
              at java.util.zip.ZipInputStream.getFileName(ZipInputStream.java:436)
              at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:255)
              at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:82)
              at com.xpn.xwiki.plugin.packaging.Package.Import(Package.java:412)
      

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              rylach Ryszard Lach
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: