Velocity macro failing in Global Administration: Extensions

I did the update to 16.0.0 last week as part of migrating our site to a new server. Today when I went to the extensions tab in the admin area, I was greeted by a macro error instead of the list of extensions:

Failed to execute the [velocity] macro. Cause: [Cannot invoke “java.util.Date.after(java.util.Date)” because the return value of “org.xwiki.extension.index.ExtensionIndexStatus.getStartDate()” is null]. Click on this message for details.

image

Does anyone know what I can do to fix this? The full text of the error is below:

org.xwiki.rendering.macro.MacroExecutionException: Failed to evaluate Velocity Macro for content [## HTML cleaner messes up the content of the legend tag.
{{html clean="false"}}
#if ($isAjaxRequest)
  #handleExtensionRequest()
#else
  <div class="full column">
  #displayExtensionSearchBar()

  #if ($request.extensionId && $request.extensionVersion)
    ## Advanced search.
    #handleExtensionRequest()
  #else
    #if ($request.index_start)
      #set ($void = $extensionManager.getRepository('index').index("wiki:${xcontext.database}"))
    #end
    ## Simple search.
    #set ($noResultsMessageKey = 'extensions.search.noResults')
    #set ($paginationParams = {})
    ## Dump whitespace generated by the pagination macro
    #set ($discard = "#paginationPrepareParams($paginationParams)")
    #if ("$!selectedRepositoryId" != '')
      #set ($repository = $extensionManager.getRepository($selectedRepositoryId))
      #if ("$!request.search" == '')
        ## Fetch extensions from known repositories.
        #if ($selectedRepositoryId == 'core')
          #set($extensions = $services.extension.core.getCoreExtensions())
        #elseif ($selectedRepositoryId == 'installed')
          #if ($xcontext.isMainWiki())
            #set($extensions = $services.extension.installed.getInstalledExtensions())
          #else
            #set($extensions = $services.extension.installed.getInstalledExtensions($extensionNamespace))
          #end
        #elseif ($selectedRepositoryId == 'local')
          #set($extensions = $services.extension.local.getLocalExtensions())
        #end
        #if ($extensions)
          #set ($totalHits = $extensions.size())
          #if ($totalHits == 0)
            #set ($noResultsMessageKey = "extensions.search.repository.${selectedRepositoryId}.empty")
          #end
          ## All extensions from the specified repository have been fetched. We need to display only the current page.
          #set ($extensions = $extensions.subList($paginationParams.firstItem, $mathtool.min($extensions.size(), $mathtool.add($paginationParams.firstItem, $paginationParams.itemsPerPage))))
        #end
      #end
    #end
    #if (!$extensions)
      #set($extensionQuery = $services.extension.index.newQuery("$!request.search"))
      #set($void = $extensionQuery.setOffset($paginationParams.firstItem))
      #set($void = $extensionQuery.setLimit($paginationParams.itemsPerPage))
      #if ($selectedRepositoryId == 'installed')
        #if ($xcontext.isMainWiki())
          #set ($extensions = $services.extension.installed.repository.searchInstalledExtensions($extensionQuery))
        #else
          ## When searching for installed extensions in a subwiki we need to take the namespace into account.
          #set ($extensions = $services.extension.installed.repository.searchInstalledExtensions($extensionNamespace, $extensionQuery))
        #end
      #elseif ($repository)
        #set ($extensions = $repository.search($extensionQuery))
      #else
        #if ($recommended)
          #set($void = $extensionQuery.addFilter('recommended', true, 'EQUAL'))
        #end
        #if ($indexed)
          #set ($repository = $extensionManager.index.repository)
          #if ($compatible)
            #set ($void = $extensionQuery.setCompatible(true, '', "wiki:$xcontext.database"))
          #end
        #else
          #set ($repository = $extensionManager)
        #end
        #set ($extensions = $repository.search($extensionQuery))
      #end
      #set ($totalHits = $extensions.totalHits)
    #end

    #if ($recommended)
      #if (!$extensions.iterator().hasNext())
        <div class="box warningmessage">$services.localization.render('extensions.search.recommended.fallback', ["<em>$!escapetool.xml($request.search)</em>"])</div>
        ## Search again with the recommended filter
        #set ($extensions = $repository.search("$!request.search", $paginationParams.firstItem, $paginationParams.itemsPerPage))
        #set ($totalHits = $extensions.totalHits)
        #set ($recommended = false)
      #elseif (!$customExtensionFilter)
        <div class="box infomessage">
          #if ($compatible)
            $services.localization.render('extensions.search.compatiblerecommended.disclaimer')
          #else
            $services.localization.render('extensions.search.recommended.disclaimer')
          #end
          <form action="${xwiki.relativeRequestURL}">
            #if ($request.section)
              <input type="hidden" name="section" value="${escapetool.xml($request.section)}" />
            #end
            <input type="hidden" name="search" value="$!{escapetool.xml($request.search)}" />
            <input type="hidden" name="recommended" value="false" />
            <input type="hidden" name="indexed" value="$indexed" />
            <input type="hidden" name="compatible" value="$compatible" />
            #if ($compatible)
              <input type="submit" value="${escapetool.xml($services.localization.render('extensions.search.compatible.all.label'))}" class="btn btn-default"/>
            #else
              <input type="submit" value="${escapetool.xml($services.localization.render('extensions.search.all.label'))}" class="btn btn-default"/>
            #end
          </form>
        </div>
      #end
    #end

    #if (!$extensions.iterator().hasNext())
      <div class="box infomessage">$services.localization.render($noResultsMessageKey, ["<em>$!escapetool.xml($request.search)</em>"])</div>
    #else
      #if ($totalHits && $totalHits > $paginationParams.itemsPerPage)
        #set ($hasPagination = true)
        #set ($paginationParams.totalItems = $totalHits)
        #set ($paginationParams.url = $doc.getURL($xcontext.action, $request.getQueryString().replaceAll('(^|&)firstIndex=[^&]++&?', '$1')))
        #pagination($paginationParams)
      #end
      #foreach($extension in $extensions)
        #displayExtension($extension)
      #end
      #if ($hasPagination)
        #set ($discard = $paginationParams.put('position', 'bottom'))
        #pagination($paginationParams)
      #end
    #end

    #if ($indexed)
      #set ($indexJobStatus = $repository.getStatus("wiki:${xcontext.database}"))
      #if ($indexJobStatus)
        <div class="box infomessage">
        #if ($indexJobStatus.state != 'FINISHED')
          $escapetool.xml($services.localization.render('extensions.search.indexed.started', [$xwiki.formatDate($indexJobStatus.startDate)]))
          #set ($discard = $xwiki.jsfx.use('uicomponents/job/job.js'))
          #set ($jobStatusURL = $doc.getURL('get', $escapetool.url({
              'xpage': 'job_status_json',
              'outputSyntax': 'plain',
              'jobId': $indexJobStatus.request.id
            })))
          <div class="xcontent job-status" data-url="$escapetool.xml($jobStatusURL)">
            #displayJobProgressBar($indexJobStatus, true)
          </div>
        #else
          $escapetool.xml($services.localization.render('extensions.search.indexed.on', [$xwiki.formatDate($indexJobStatus.startDate)]))
        #end
      #else
        <div class="box warningmessage">$escapetool.xml($services.localization.render('extensions.search.indexed.nojob'))
      #end
        <form action="${xwiki.relativeRequestURL}">
          #if ($request.section)
            <input type="hidden" name="section" value="${escapetool.xml($request.section)}" />
          #end
          <input type="hidden" name="search" value="$!{escapetool.xml($request.search)}" />
          <input type="hidden" name="recommended" value="$recommended" />
          <input type="hidden" name="indexed" value="$indexed" />
          <input type="hidden" name="compatible" value="$compatible" />
          #if ($indexJobStatus.state != 'RUNNING')
            <input type="submit" value="${escapetool.xml($services.localization.render('extensions.search.indexed.reindex'))}" name="index_start" class="btn btn-default"/>
          #end
        </form>
      </div>
    #end
  #end
  </div>
#end
{{/html}}]
 at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:186)
 at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:60)
 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:311)
 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:112)
 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:1366)
 at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1503)
 at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1470)
 at com.xpn.xwiki.XWiki.getRenderedContent(XWiki.java:4527)
 at com.xpn.xwiki.XWiki.include(XWiki.java:4464)
 at com.xpn.xwiki.api.XWiki.includeForm(XWiki.java:1825)
 at com.xpn.xwiki.api.XWiki.includeForm(XWiki.java:1785)
 at jdk.internal.reflect.GeneratedMethodAccessor773.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.ASTBlock.render(ASTBlock.java:147)
 at org.apache.velocity.runtime.parser.node.ASTElseIfStatement.render(ASTElseIfStatement.java:108)
 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.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.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.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.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:225)
 at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:173)
 at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:177)
 at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:60)
 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:311)
 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:112)
 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:245)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.applySheet(SheetDocumentDisplayer.java:225)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.maybeDisplayWithSheet(SheetDocumentDisplayer.java:180)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:111)
 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.script.display.DisplayScriptService.document(DisplayScriptService.java:143)
 at com.xpn.xwiki.script.display.DisplayScriptService.content(DisplayScriptService.java:206)
 at com.xpn.xwiki.script.display.DisplayScriptService.content(DisplayScriptService.java:165)
 at jdk.internal.reflect.GeneratedMethodAccessor1130.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.parser.node.ASTIfStatement.render(ASTIfStatement.java:171)
 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.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.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:225)
 at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:105)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:219)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.renderVelocity(TemplateAsyncRenderer.java:174)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:135)
 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:904)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:866)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:846)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:832)
 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:2564)
 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:108)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
 at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:375)
 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1594)
 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with namespace [xwiki:XWiki.XWikiPreferences]
 at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:227)
 at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:173)
 at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:177)
 ... 166 more
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getStatus' in  class org.xwiki.extension.script.internal.safe.SafeExtensionIndex threw exception java.lang.NullPointerException: Cannot invoke "java.util.Date.after(java.util.Date)" because the return value of "org.xwiki.extension.index.ExtensionIndexStatus.getStartDate()" is null at xwiki:XWiki.XWikiPreferences[line 127, column 37]
 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.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.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.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.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:225)
 ... 168 more
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Date.after(java.util.Date)" because the return value of "org.xwiki.extension.index.ExtensionIndexStatus.getStartDate()" is null
 at org.xwiki.extension.index.internal.job.ExtensionIndexJobScheduler.getStatus(ExtensionIndexJobScheduler.java:169)
 at org.xwiki.extension.index.internal.DefaultExtensionIndex.getStatus(DefaultExtensionIndex.java:85)
 at org.xwiki.extension.script.internal.safe.SafeExtensionIndex.getStatus(SafeExtensionIndex.java:59)
 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
 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)
 ... 184 more

Upon further experimentation, the problem appears to be in the Available Extensions display. If I grab the path to Installed Extensions from a working XWiki instance and paste it into the URL bar after the base URL, I can successfully view Installed Extensions.

If I then select Available Extensions from the dropdown box, I get the error.

Hi,

unfurtunately, I’ve got the same problem. Any further solutions?

Thanks a lot!

hi, it’d be helpful if you could provide more information on your XWiki installation. Yesterday, I performed an upgrade via WAR of my XWiki from 15.10.5 up to 16.0.0 with the Tomcat 9.0.84 servlet and PostgreSQL 16, and I can navigate in EM (Extension Manager) from Administration or the page itself “XWiki.Extensions”, no velocity errors

Also, XWiki 16.0.0 requires Java 17+ that I have on my end jdk-17

In my case, I installed XWiki using the deb package method on a new Ubuntu 20.04.6 LTS server. I had originally installed 15.10.5 and upgraded via apt to 16.0.0. Initially, my configuration was pointing to the wrong version of Java, but I fixed that and got the site running.

Then on a second, older server also running 20.04.6 LTS, I pefrormed the upgrade to 16.0.0 successfully and then did a site backup. Once done, I used the backup to restore the content to the new server.

Both servers are running Tomcat 9.0.31.0 and OpenJDK 17.0.9.
Both servers are using MariaDB: Ver 15.1 Distrib 10.3.39-MariaDB.
Both the old an new server are having the same problem.

I also have a local installation on my PC running Ubuntu 22.04.3 LTS which is working correctly.

Note that it is ONLY the “Available Extensions” that I can’t display. If I paste the following after my base URL: /xwiki/bin/admin/XWiki/XWikiPreferences?section=XWiki.Extensions&search=&repo=installed, I can view the installed, local, and core extensions.

But when going to /xwiki/bin/admin/XWiki/XWikiPreferences?section=XWiki.Extensions&search=&repo= or just /xwiki/bin/admin/XWiki/XWikiPreferences?section=XWiki.Extensions for the available extensions, I get the error. These are the URLs used by XWiki itself when clicking on the various links to view extensions.

However, I just discovered that if I explicitly specify ‘available’ in the URL: https://developerhelp.microchip.com/xwiki/bin/admin/XWiki/XWikiPreferences?section=XWiki.Extensions&search=&repo=available, then it works!

So it appears that on my two server installations, it doesn’t like it when the repo parameter is null.

I don’t have it on my side. Unfortunately, I’m using Windows 10 OS and not Ubuntu, maybe some other users who are using Ubuntu can look into it.

Can you see the page itself http://localhost/xwiki/bin/view/XWiki/Extensions?

No, that also gives the same error. But it does work if I add ?repo=available to the end of that URL.

If I go to “http://localhost/xwiki/bin/view/XWiki/Extensions?”, I’m also getting the error. I have the same setting as Redhorse has:

Ubuntu 20.04.3 LTS / Tomcat 9.0.31.0 / OpenJDK 17.0.9).

Here it is not working in Debian 12 / Jetty 10.0.19 / OpenJDK 17.0.10
But it still works on Debian 12 / Tomcat 9.0.43 / OpenJDK 17.0.10

Any news on this? I’m still getting the error-message und can’t search for new extensions.

Thanks a lot!

I’m getting the same problems on my xwiki. I also installed xwiki as a deb package on ubuntu 20.04 on version 15 and have now updated to 16.5.
I would be grateful for any help.

PS: I should note that the link presented above also works fine for me: localhost/xwiki/bin/admin/XWiki/XWikiPreferences?section=XWiki.Extensions&search=&repo=available

Unfortunately the problem is still there for me too in 16.5.0. I haven’t made any progress on figuring out what might be happening. It would be great if one of the XWiki experts had some insight…

In the meantime, I’ve had to use my URL hack anytime I want to view available extensions.

That nullpointer is very strange. I guess we could bulletproof that code, but I’m wondering if this might not be the sign that there are some missing --add-opens as documented on https://dev.xwiki.org/xwiki/bin/view/Community/SupportStrategy/JavaSupportStrategy/#HSupportedJavaVersions.

The missing --add-opens are a possibility based on a past XWiki upgrade with Java 11 that should have had Java 17. Where should those switches be added? I’m still not familiar enough with Java or the many files that control XWiki to know where they belong. The page you linked to just mentions the switches but doesn’t explain where to add them.

Yes, that’s because it depends a lot on the application server you are using and in which context. For example, on Debian-like distributions that would be in /etc/default/tomcat9 (when you use the tomcat9 standard Debian package).

Thanks! That helps. I’ll give it a try shortly.