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

Error saving when trying to add an object to a translation document

    XMLWordPrintable

Details

    • Bug
    • Resolution: Solved By
    • Critical
    • None
    • 12.9
    • Actions
    • None
    • Unknown
    • N/A
    • N/A

    Description

      In a 12.9 wiki, setup in multilingual (or in french monolingual), if you:

      1/ Setup wiki is multilingual with french or monolingual french
      2/ Go to home page
      3/ Switch to french version
      4/ Edit object
      5/ Add an object (example GadgetClass)
      6/ Try saving

      Error previewdiff shows up. Exception in log is the following:

      code
      2020-11-12 09:12:44,986 [qtp1749186397-1801 - http://localhost:12980/xwiki/bin/preview/Main/?diff=1&version=3.2] ERROR c.x.x.XWiki - Error while evaluating velocity template [previewdiff.vm]
      org.xwiki.rendering.RenderingException: Failed to execute renderer
      at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:270)
      at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:250)
      at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.render(DefaultBlockAsyncRendererExecutor.java:154)
      at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:772)
      at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:745)
      at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:725)
      at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:711)
      at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:78)
      at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2516)
      at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:179)
      at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:572)
      at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:250)
      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.doPost(ActionServlet.java:462)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1411)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:763)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1631)
      at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1618)
      at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:106)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1618)
      at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1618)
      at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1618)
      at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1618)
      at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:549)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1610)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1369)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:489)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1284)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      at org.eclipse.jetty.server.Server.handle(Server.java:501)
      at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
      at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
      at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: org.xwiki.rendering.RenderingException: Failed to evaluate template with id [/skins/flamingo/previewdiff.vm]
      at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:219)
      at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.renderVelocity(TemplateAsyncRenderer.java:180)
      at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:137)
      at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:53)
      at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.lambda$syncRender$0(DefaultAsyncRendererExecutor.java:267)
      at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98)
      at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:267)
      ... 65 common frames omitted
      Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with namespace [/skins/flamingo/previewdiff.vm]
      at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:292)
      at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:316)
      at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:95)
      at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:217)
      ... 71 common frames omitted
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'mergeDocument' in class org.xwiki.store.merge.MergeScriptService threw exception java.lang.NullPointerException at /skins/flamingo/previewdiff.vm[line 24, column 42]
      at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:306)
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:233)
      at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:369)
      at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:701)
      at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:72)
      at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:240)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:423)
      at org.apache.velocity.Template.merge(Template.java:358)
      at org.apache.velocity.Template.merge(Template.java:262)
      at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:284)
      ... 74 common frames omitted
      Caused by: java.lang.NullPointerException: null
      at org.xwiki.store.merge.MergeScriptService.mergeDocument(MergeScriptService.java:82)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:565)
      at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:548)
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:219)
      ... 82 common frames omitted
      code

      A workaround is to add the object to the english page (which is ok as objects are shared accross translations). However in monolingual french wiki this workaround might not work and therefore we are stuck.

      Marking the issue as critical as it affects the home page on a french wiki.

      Attachments

        1. previewdiff.png
          175 kB
          Ludovic Dubost
        2. Saved_by_merging_changes.png
          42 kB
          Ilie Andriuta

        Issue Links

          Activity

            People

              sumit1212 JHA SUMIT
              ludovic Ludovic Dubost
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: