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

Error preventing the execution of Tag Cloud macro if the limit set is higher than the number of existing tags

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 15.2-rc-1
    • 15.1-rc-1
    • Tag
    • None
    • Windows 11 Pro, Firefox 110, using a local instance of XWiki 15.1 on PostgreSQL 15, Tomcat 9.0.72
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce

      1. On an instance with no tags added to any page, add 2 different tags to a page (e.g. 'tag1' and 'tag2')
      2. Edit another page
      3. Insert Tag Cloud macro
      4. In the 'Limit' box, type 3 (value higher than the number of existent tags)
      5. Click 'Submit' button

      Expected results

      The Tag Cloud macro is executed properly, it displays the 2 existent tags.

      Actual results

      An error is displayed instead:

      Failed to execute the [velocity] macro. Cause: [toIndex = 3]. Click on this message for details.

      Stacktrace from clicking on the error:

      org.xwiki.rendering.macro.MacroExecutionException: Failed to evaluate Velocity Macro for content [##
      ## tagCloudSpace - the space to display the tag cloud for. If blank, display cloud for the whole wiki. Default is blank.
      #set ($tagCloudSpace = $xcontext.macro.params.get('space'))
      #set ($tagCloudSpaces = $xcontext.macro.params.get('spaces'))
      #set ($limit = $xcontext.macro.params.get('limit'))
      ##
      ## Configurable popularity levels. You must enter an even number of levels. Default: 6.
      #set ($popularityLevels = ["notPopular", "notVeryPopular", "somewhatPopular", "popular", "veryPopular", "ultraPopular"])
      #set ($levelsHalf = $popularityLevels.size() / 2)
      ##
      $xwiki.ssx.use('XWiki.TagCloud')##
      ##
      #if( $tagCloudSpace && $tagCloudSpaces )
        {{error}}
        ##Do not use space and spaces parameter in the same time.
        {{translation key="xe.tag.paramerror" /}}
        {{/error}}
        #break
      #end
      
      ##If multiple spaces with "spaces" parameter
      #if( $tagCloudSpaces )
        #set ($tagCount = $xwiki.tag.getTagCountForSpaces($tagCloudSpaces))
      #else
        ##If only one space
        ## Get tag count map. Key: tag, value: number of occurrences.
        #set ($tagCount = $xwiki.tag.getTagCount("$!tagCloudSpace"))
      #end
      ## Organize tags as a list of {name, count} object so that it is easier to handle (sorting, limiting, ...)
      #set ($tagCountList = [])
      #foreach ($tagName in $tagCount.keySet())
        #set ($discard = $tagCountList.add({
          "name": $tagName,
          "count": $tagCount[$tagName]
        }))
      #end
      ## If a limit is set, only keep n most occurring tags
      ## If tags have the same occurrence, limit them in alphabetical order
      #set ($tagCountListSorted = $collectiontool.sort($tagCountList, ['count:desc', 'name']))
      #if ("$!limit" != '')
        #set ($tagCountListSorted = $tagCountListSorted.subList(0, $limit))
      #end
      ##
      ## Only build popularity map if at least one tag exists
      #if ($tagCountListSorted.size() > 0)
        ##
        ## Store the minimum and maximum number of occurrences.
        #set ($maxIndex = $tagCountListSorted.size() - 1)
        #set ($maxCount = $tagCountListSorted[0].count)
        #set ($minCount = $tagCountListSorted[$maxIndex].count)
        ##
        ## Calculate the total number of tags in the wiki.
        #set ($totalTagNumber = 0)
        #foreach ($currentTag in $tagCountListSorted)
          #set ($totalTagNumber = $totalTagNumber + $currentTag.count)
        #end
        #set ($countAverage = $mathtool.div($totalTagNumber, $tagCountListSorted.size()))
        ##
        ## Build popularity map using the difference between minimum / maximum tag occurrences counts, and the average tag occurences count.
        #set ($firstHalfIntervalSize = $mathtool.div($mathtool.sub($countAverage, $minCount), $levelsHalf))
        #set ($secondHalfIntervalSize = $mathtool.div($mathtool.sub($maxCount, $countAverage), $levelsHalf))
        ##
        ## Use a sorted map
        #set ($popularityMap = $collectiontool.sortedMap)
        #set ($previousPopularityMax = $minCount)
        #set ($intervalSize = $firstHalfIntervalSize)
        #set ($halfPassed = false)
        #foreach ($popularityLevel in $popularityLevels)
          #if ($foreach.count > $levelsHalf && !$halfPassed)
            #set ($intervalSize = $secondHalfIntervalSize)
            #set ($halfPassed = true)
          #end
          #set ($currentPopularityMax = $mathtool.add($previousPopularityMax, $intervalSize))
          ##
          ## round the threshold
          #set ($threshold = $mathtool.roundTo(1, $currentPopularityMax))
          #set ($discard = $popularityMap.put($threshold, $popularityLevel))
          #set ($previousPopularityMax = $currentPopularityMax)
        #end
      #end
      ##
      ## Display tag cloud.
      {{html}}
      #if ($tagCountListSorted.size() > 0)
        <ol class="tagCloud">
        #foreach ($tagEntry in $collectiontool.sort($tagCountListSorted, 'name'))
          #foreach ($popularityEntry in $popularityMap.entrySet())
            #if ($popularityEntry.Key >= $tagEntry.count)
              #set ($liClass = $popularityEntry.Value)
              #break
            #end
          #end
          <li class="$liClass">
            <a class="tag" href="$xwiki.getURL('Main.Tags', 'view', "do=viewTag&amp;tag=$escapetool.url($tagEntry.name)")" title="$services.localization.render('xe.tag.tooltip', [$tagEntry.count])">$escapetool.xml($tagEntry.name)</a>
          </li>
        #end
        </ol>
      #else
        <p class="noitems">
        #if("$!tagCloudSpace" == "")
          $services.localization.render('xe.tag.notags')
        #else
          $services.localization.render('xe.tag.notagsforspace', ["$tagCloudSpace"])
        #end
        </p>
      #end
      {{/html}}]
      
       at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:135)
      
       at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:51)
      
       at org.xwiki.rendering.macro.script.AbstractScriptMacro.evaluateBlock(AbstractScriptMacro.java:279)
      
       at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:182)
      
       at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:58)
      
       at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:309)
      
       at org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183)
      
       at org.xwiki.rendering.async.internal.block.AbstractBlockAsyncRenderer.transform(AbstractBlockAsyncRenderer.java:76)
      
       at org.xwiki.rendering.wikimacro.internal.DefaultWikiMacroRenderer.transform(DefaultWikiMacroRenderer.java:876)
      
       at org.xwiki.rendering.wikimacro.internal.DefaultWikiMacroRenderer.transform(DefaultWikiMacroRenderer.java:862)
      
       at org.xwiki.rendering.wikimacro.internal.DefaultWikiMacroRenderer.transform(DefaultWikiMacroRenderer.java:595)
      
       at org.xwiki.rendering.wikimacro.internal.DefaultWikiMacroRenderer.execute(DefaultWikiMacroRenderer.java:410)
      
       at org.xwiki.rendering.async.internal.block.AbstractBlockAsyncRenderer.render(AbstractBlockAsyncRenderer.java:157)
      
       at org.xwiki.rendering.async.internal.block.AbstractBlockAsyncRenderer.render(AbstractBlockAsyncRenderer.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)
      
       at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267)
      
       at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.execute(DefaultBlockAsyncRendererExecutor.java:125)
      
       at org.xwiki.rendering.wikimacro.internal.DefaultWikiMacro.execute(DefaultWikiMacro.java:110)
      
       at org.xwiki.rendering.wikimacro.internal.DefaultWikiMacro.execute(DefaultWikiMacro.java:53)
      
       at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:309)
      
       at org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183)
      
       at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:88)
      
       at org.xwiki.display.internal.DocumentContentAsyncExecutor.executeInCurrentExecutionContext(DocumentContentAsyncExecutor.java:395)
      
       at org.xwiki.display.internal.DocumentContentAsyncExecutor.execute(DocumentContentAsyncExecutor.java:268)
      
       at org.xwiki.display.internal.DocumentContentAsyncRenderer.execute(DocumentContentAsyncRenderer.java:107)
      
       at org.xwiki.rendering.async.internal.block.AbstractBlockAsyncRenderer.render(AbstractBlockAsyncRenderer.java:157)
      
       at org.xwiki.rendering.async.internal.block.AbstractBlockAsyncRenderer.render(AbstractBlockAsyncRenderer.java:54)
      
       at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:290)
      
       at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267)
      
       at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.execute(DefaultBlockAsyncRendererExecutor.java:125)
      
       at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:67)
      
       at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:43)
      
       at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:96)
      
       at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:39)
      
       at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:123)
      
       at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:52)
      
       at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:68)
      
       at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:42)
      
       at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1349)
      
       at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1486)
      
       at com.xpn.xwiki.doc.XWikiDocument.displayDocument(XWikiDocument.java:1435)
      
       at com.xpn.xwiki.doc.XWikiDocument.displayDocument(XWikiDocument.java:1404)
      
       at com.xpn.xwiki.api.Document.displayDocument(Document.java:785)
      
       at jdk.internal.reflect.GeneratedMethodAccessor796.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)
      
       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.SimpleNode.render(SimpleNode.java:439)
      
       at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:190)
      
       at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
      
       at org.xwiki.velocity.internal.directive.TryCatchDirective.render(TryCatchDirective.java:86)
      
       at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304)
      
       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)
      
       at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:321)
      
       at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:95)
      
       at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:222)
      
       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)
      
       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.render(InternalTemplateManager.java:792)
      
       at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:747)
      
       at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:739)
      
       at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:79)
      
       at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:73)
      
       at org.xwiki.template.script.TemplateScriptService.render(TemplateScriptService.java:54)
      
       at jdk.internal.reflect.GeneratedMethodAccessor251.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)
      
       at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
      
       at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:492)
      
       at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
      
       at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:218)
      
       at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:331)
      
       at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:261)
      
       at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304)
      
       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)
      
       at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:321)
      
       at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:95)
      
       at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:222)
      
       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)
      
       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.render(InternalTemplateManager.java:792)
      
       at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:747)
      
       at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:739)
      
       at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:79)
      
       at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:73)
      
       at org.xwiki.template.script.TemplateScriptService.render(TemplateScriptService.java:54)
      
       at jdk.internal.reflect.GeneratedMethodAccessor251.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)
      
       at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
      
       at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:492)
      
       at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
      
       at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:218)
      
       at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:331)
      
       at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:261)
      
       at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304)
      
       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)
      
       at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:321)
      
       at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:95)
      
       at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:222)
      
       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)
      
       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.render(InternalTemplateManager.java:792)
      
       at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:747)
      
       at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:739)
      
       at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:79)
      
       at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:73)
      
       at org.xwiki.template.script.TemplateScriptService.render(TemplateScriptService.java:54)
      
       at jdk.internal.reflect.GeneratedMethodAccessor251.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)
      
       at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
      
       at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:492)
      
       at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
      
       at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:218)
      
       at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:331)
      
       at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:261)
      
       at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304)
      
       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)
      
       at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:321)
      
       at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:95)
      
       at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:222)
      
       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)
      
       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:2553)
      
       at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:180)
      
       at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:612)
      
       at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:300)
      
       at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:112)
      
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
      
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
      
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      
       at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
      
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      
       at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
      
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      
       at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      
       at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
      
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      
       at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
      
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      
       at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
      
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      
       at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
      
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
      
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
      
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
      
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
      
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
      
       at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
      
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
      
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
      
       at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
      
       at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
      
       at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926)
      
       at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)
      
       at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      
       at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
      
       at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
      
       at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      
       at java.base/java.lang.Thread.run(Thread.java:833)
      
      Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with namespace [xwiki:a1.WebHome]
      
       at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:289)
      
       at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:321)
      
       at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:127)
      
       ... 235 more
      
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'subList' in  class java.util.ArrayList threw exception java.lang.IndexOutOfBoundsException: toIndex = 3 at xwiki:a1.WebHome[line 41, column 49]
      
       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)
      
       ... 237 more
      
      Caused by: java.lang.IndexOutOfBoundsException: toIndex = 3
      
       at java.base/java.util.AbstractList.subListRangeCheck(AbstractList.java:507)
      
       at java.base/java.util.ArrayList.subList(ArrayList.java:1108)
      
       at java.base/jdk.internal.reflect.GeneratedMethodAccessor626.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.xwiki.velocity.introspection.MethodArgumentsUberspector$ConvertingVelMethod.invoke(MethodArgumentsUberspector.java:306)
      
       at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221)
      
       ... 247 more

       

      Attachments

        Issue Links

          Activity

            People

              mleduc Manuel Leduc
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: