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

Error when locally renaming a page imported from an external subwiki

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 5.2
    • Display
    • jetty
    • Unknown
    • N/A
    • N/A

    Description

      Exported a page from design.xwiki.org and imported it locally.
      Tried to rename it to another name.

      The following error occured

      Error number 4001 in 4: Error while parsing velocity page /templates/rename.vm
      Error number 4001 in 4: Error while parsing velocity page /templates/rename.vm
      com.xpn.xwiki.XWikiException: Error number 4001 in 4: Error while parsing velocity page /templates/rename.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:1841)
      	at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:166)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:303)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:128)
      	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448)
      	at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:121)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
      	at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:144)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
      	at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:66)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
      	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
      	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
      	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
      	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
      	at org.eclipse.jetty.server.Server.handle(Server.java:368)
      	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:488)
      	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:943)
      	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1004)
      	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861)
      	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
      	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
      	at java.lang.Thread.run(Thread.java:680)
      Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [/templates/rename.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)
      	... 48 more
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'rename' in  class com.xpn.xwiki.api.Document threw exception com.xpn.xwiki.XWikiException: Error number 3301 in 3: Exception while switching to database xwiki at /templates/rename.vm[line 61, column 16]
      	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.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.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.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.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)
      	... 50 more
      Caused by: com.xpn.xwiki.XWikiException: Error number 3301 in 3: Exception while switching to database xwiki
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:700)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:872)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:772)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1260)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeWrite(XWikiHibernateBaseStore.java:1347)
      	at com.xpn.xwiki.store.XWikiHibernateVersioningStore.saveXWikiDocArchive(XWikiHibernateVersioningStore.java:175)
      	at com.xpn.xwiki.XWiki.copyDocument(XWiki.java:4190)
      	at com.xpn.xwiki.XWiki.copyDocument(XWiki.java:4116)
      	at com.xpn.xwiki.XWiki.copyDocument(XWiki.java:4107)
      	at com.xpn.xwiki.XWiki.copyDocument(XWiki.java:4079)
      	at com.xpn.xwiki.doc.XWikiDocument.rename(XWikiDocument.java:6089)
      	at com.xpn.xwiki.api.Document.rename(Document.java:2714)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	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)
      	... 66 more
      Caused by: java.lang.NullPointerException
      	at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.getXWikiContext(AbstractDataMigrationManager.java:284)
      	at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.getDataMigrationStatus(AbstractDataMigrationManager.java:407)
      	at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:521)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:696)
      	... 84 more
      
      

      Not the first time this happens. I remember also a long time ago when importing locally pages from incubator.

      Attachments

        1. browser.png
          198 kB
          Ecaterina Moraru (Valica)
        2. browserAfterRename.png
          193 kB
          Ecaterina Moraru (Valica)
        3. DesignCode.IterationSheet.xar
          1 kB
          Ecaterina Moraru (Valica)

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              evalica Ecaterina Moraru (Valica)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: