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

Clicking on a link to a non-existing page with WebHome last segment displays an error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 14.10.18
    • None
    • Unknown

    Description

      Reproduction steps

      1. Edit a page
      2. Insert a link to a page, ending with WebHome (e.g., [[A.WebHome]])
      3. Save the page
      4. Click on the link

      Expected

      The non-existing page creation modal is displayed

      Actual

      A modal with an error is displayed

      And the following logs are printed

      2023-12-20 10:17:54,151 [qtp674483268-893 - http://localhost:8080/xwiki/bin/create/A/WebHome?parent=Main.WebHome&xpage=createinline&ajax=1] ERROR c.x.x.XWiki                    - Error while evaluating velocity template [createinline.vm] 
      org.xwiki.rendering.RenderingException: Failed to execute renderer
      	at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:287)
      	at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267)
      	at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.render(DefaultBlockAsyncRendererExecutor.java:154)
      	at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:843)
      	at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:805)
      	at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:785)
      	at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:771)
      	at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:91)
      	at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:85)
      	at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2563)
      	at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:180)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:651)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:339)
      	at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:114)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
      	at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1419)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
      	at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1624)
      	at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
      	at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
      	at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
      	at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
      	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
      	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
      	at org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:164)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:506)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1571)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1378)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:463)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1544)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1300)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
      	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:192)
      	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:51)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      	at org.eclipse.jetty.server.Server.handle(Server.java:562)
      	at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:418)
      	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:675)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:410)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:319)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
      	at org.eclipse.jetty.io.SocketChannelEndPoint$1.run(SocketChannelEndPoint.java:101)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:894)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1038)
      	at java.base/java.lang.Thread.run(Thread.java:840)
      Caused by: org.xwiki.rendering.RenderingException: Failed to evaluate template with id [/templates/createinline.vm]
      	at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:224)
      	at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.renderVelocity(TemplateAsyncRenderer.java:177)
      	at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:138)
      	at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:54)
      	at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.lambda$syncRender$0(DefaultAsyncRendererExecutor.java:284)
      	at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98)
      	at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:284)
      	... 66 common frames omitted
      Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with namespace [/templates/createinline.vm]
      	at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:289)
      	at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:328)
      	at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:95)
      	at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:222)
      	... 72 common frames omitted
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'createDocumentReference' in  class org.xwiki.model.script.ModelScriptService threw exception java.lang.IllegalArgumentException: Invalid parent reference [null] in a document reference at /templates/createinline.vm[line 365, column 62]
      	at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:308)
      	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:235)
      	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
      	at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:704)
      	at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:75)
      	at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:242)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
      	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:171)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
      	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:280)
      	... 75 common frames omitted
      Caused by: java.lang.IllegalArgumentException: Invalid parent reference [null] in a document reference
      	at org.xwiki.model.reference.DocumentReference.setParent(DocumentReference.java:243)
      	at org.xwiki.model.reference.EntityReference.<init>(EntityReference.java:157)
      	at org.xwiki.model.reference.AbstractLocalizedEntityReference.<init>(AbstractLocalizedEntityReference.java:76)
      	at org.xwiki.model.reference.DocumentReference.<init>(DocumentReference.java:174)
      	at org.xwiki.model.script.ModelScriptService.createDocumentReference(ModelScriptService.java:146)
      	at jdk.internal.reflect.GeneratedMethodAccessor498.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
      	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:571)
      	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:554)
      	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221)
      	... 85 common frames omitted
      

      Attachments

        Activity

          People

            mleduc Manuel Leduc
            mleduc Manuel Leduc
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: