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

User's watchlist corrupted when migrating from XE 2.5 to XE 5.3

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 5.4.2, 6.0-milestone-1
    • 5.3
    • {Unused} Watchlist
    • None
    • Operating System: Centos, Linux 2.6.18-164.15.1.el5 #1 x86_64
      Database: Oracle 10g
      Application Server: Apache Tomcat 6.0.26
      JDK: 1.6.0_20
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      After the migration from XE 2.5 to XE 5.3, the Space List in user's watchlist has been corrupted with a heading comma, for example like this:

      ,xwiki:XWiki,xwiki:Main
      

      this causes an error that prevents the header section of the page to be displayed. The stacktrace produced by the section is the following:

      Error number 4001 in 4: Error while parsing velocity page /templates/menuview.vm 
      com.xpn.xwiki.XWikiException: Error number 4001 in 4: Error while parsing velocity page /templates/menuview.vm 
              at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:110) 
              at com.xpn.xwiki.internal.template.DefaultPrivilegedTemplateRenderer.evaluate(DefaultPrivilegedTemplateRenderer.java:125) 
              at com.xpn.xwiki.internal.template.DefaultPrivilegedTemplateRenderer.evaluateTemplate(DefaultPrivilegedTemplateRenderer.java:75) 
              at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1687) 
              at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1627) 
              at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:918) 
              at sun.reflect.GeneratedMethodAccessor167.invoke(Unknown Source) 
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
              at java.lang.reflect.Method.invoke(Method.java:597) 
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) 
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) 
              at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) 
              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.directive.VelocimacroProxy.render(VelocimacroProxy.java:216) 
              at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311) 
              at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230) 
              at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) 
              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.SimpleNode.render(SimpleNode.java:342) 
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:228) 
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:187) 
              at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:105) 
              at com.xpn.xwiki.internal.template.DefaultPrivilegedTemplateRenderer.evaluate(DefaultPrivilegedTemplateRenderer.java:125) 
              at com.xpn.xwiki.internal.template.DefaultPrivilegedTemplateRenderer.evaluateTemplate(DefaultPrivilegedTemplateRenderer.java:75) 
              at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1687) 
              at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1627) 
              at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:918) 
              at sun.reflect.GeneratedMethodAccessor167.invoke(Unknown Source) 
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
              at java.lang.reflect.Method.invoke(Method.java:597) 
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) 
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) 
              at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) 
              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.directive.VelocimacroProxy.render(VelocimacroProxy.java:216) 
              at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311) 
              at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230) 
              at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) 
              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:228) 
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:187) 
              at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:105) 
              at com.xpn.xwiki.internal.template.DefaultPrivilegedTemplateRenderer.evaluate(DefaultPrivilegedTemplateRenderer.java:125) 
              at com.xpn.xwiki.internal.template.DefaultPrivilegedTemplateRenderer.evaluateTemplate(DefaultPrivilegedTemplateRenderer.java:75) 
              at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1687) 
              at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:166) 
              at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:88) 
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:331) 
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:129) 
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) 
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) 
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) 
              at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) 
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:121) 
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
              at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:144) 
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
              at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:66) 
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
              at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208) 
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
              at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111) 
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) 
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) 
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) 
              at java.lang.Thread.run(Thread.java:619) 
      Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [/templates/menuview.vm] 
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:247) 
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:187) 
              at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:105) 
              ... 89 more 
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'isSpaceWatched' in  class com.xpn.xwiki.plugin.watchlist.WatchListPluginApi threw exception java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at /templates/menuview.vm[line 257, column 27] 
              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.evaluate(ASTReference.java:530) 
              at org.apache.velocity.runtime.parser.node.ASTExpression.evaluate(ASTExpression.java:62) 
              at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:85) 
              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.ASTBlock.render(ASTBlock.java:72) 
              at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) 
              at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) 
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:228) 
              ... 91 more 
      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 
              at java.lang.String.substring(String.java:1937) 
              at com.xpn.xwiki.plugin.watchlist.WatchListStore.unescapeList(WatchListStore.java:444) 
              at com.xpn.xwiki.plugin.watchlist.WatchListStore.getWatchedElements(WatchListStore.java:420) 
              at com.xpn.xwiki.plugin.watchlist.WatchListPluginApi.isSpaceWatched(WatchListPluginApi.java:166) 
              at sun.reflect.GeneratedMethodAccessor600.invoke(Unknown Source) 
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
              at java.lang.reflect.Method.invoke(Method.java:597) 
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) 
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) 
              at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) 
              ... 104 more 
      

      removing the comma in front of the list fixes the problem.

      Attachments

        Activity

          People

            camil7 Clemens Robbenhaar
            ccoreggioli Claudio Coreggioli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: