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

NPE in WebappResourceLoader during xwiki-platform-tool-packager-plugin

    Details

    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      We obtain an NPE during the execution of xwiki-platform-tool-packager-plugin in xwiki-platform-distribution-flavor-jetty-hsqldb, with the following stacktrace:

      [INFO] Starting job of type [wiki.init] with identifier [[initialization, wiki, xwiki]]
      [INFO] Start initialization of wiki [xwiki]
      [INFO] Initialization if wiki [xwiki] done
      [ERROR] WebappResourceLoader: unable to retrieve ServletContext
      [ERROR] ResourceManager.getResource() load exception
      java.lang.NullPointerException
          at org.apache.velocity.tools.view.WebappResourceLoader.getResourceStream (WebappResourceLoader.java:145)
          at org.apache.velocity.Template.process (Template.java:108)
          at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource (ResourceManagerImpl.java:437)
          at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource (ResourceManagerImpl.java:352)
          at org.apache.velocity.runtime.RuntimeInstance.getTemplate (RuntimeInstance.java:1533)
          at org.apache.velocity.runtime.RuntimeInstance.getTemplate (RuntimeInstance.java:1514)
          at org.apache.velocity.runtime.VelocimacroFactory.initVelocimacro (VelocimacroFactory.java:202)
          at org.apache.velocity.runtime.RuntimeInstance.init (RuntimeInstance.java:274)
          at org.apache.velocity.app.VelocityEngine.init (VelocityEngine.java:93)
          at org.xwiki.velocity.internal.DefaultVelocityEngine.initialize (DefaultVelocityEngine.java:125)
          at org.xwiki.velocity.internal.DefaultVelocityFactory.createVelocityEngine (DefaultVelocityFactory.java:90)
          at com.xpn.xwiki.render.DefaultVelocityManager.getVelocityEngine (DefaultVelocityManager.java:324)
          at org.xwiki.display.internal.AbstractDocumentTitleDisplayer.evaluateTitle (AbstractDocumentTitleDisplayer.java:227)
          at org.xwiki.display.internal.AbstractDocumentTitleDisplayer.displayTitle (AbstractDocumentTitleDisplayer.java:166)
          at org.xwiki.display.internal.AbstractDocumentTitleDisplayer.display (AbstractDocumentTitleDisplayer.java:150)
          at org.xwiki.display.internal.AbstractDocumentTitleDisplayer.display (AbstractDocumentTitleDisplayer.java:59)
          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.getRenderedTitle (XWikiDocument.java:1689)
          at org.xwiki.eventstream.store.internal.DocumentEventRecorder.recordEvent (DocumentEventRecorder.java:140)
          at org.xwiki.eventstream.store.internal.DocumentEventRecorder.recordEvent (DocumentEventRecorder.java:121)
          at org.xwiki.eventstream.store.internal.DocumentEventListener.onEvent (DocumentEventListener.java:127)
          at org.xwiki.observation.internal.DefaultObservationManager.notify (DefaultObservationManager.java:309)
          at org.xwiki.observation.internal.DefaultObservationManager.notify (DefaultObservationManager.java:274)
          at com.xpn.xwiki.XWiki.saveDocument (XWiki.java:1918)
          at com.xpn.xwiki.XWiki.saveDocument (XWiki.java:1798)
          at com.xpn.xwiki.XWiki.saveDocument (XWiki.java:1788)
          at org.xwiki.component.wiki.internal.DefaultWikiComponentBuilderEventListener.update (DefaultWikiComponentBuilderEventListener.java:214)
          at org.xwiki.component.wiki.internal.DefaultWikiComponentBuilderEventListener.installOrUpdateComponentXClass (DefaultWikiComponentBuilderEventListener.java:148)
          at org.xwiki.component.wiki.internal.DefaultWikiComponentBuilderEventListener.onEvent (DefaultWikiComponentBuilderEventListener.java:94)
          at org.xwiki.observation.internal.DefaultObservationManager.notify (DefaultObservationManager.java:309)
          at org.xwiki.observation.internal.DefaultObservationManager.notify (DefaultObservationManager.java:274)
          at com.xpn.xwiki.internal.WikiInitializerJob.runInternal (WikiInitializerJob.java:120)
      

      The error doesn't prevent the build to finish, but afterwards we have the following logs in the running instance:

      2019-05-20 16:33:27,143 [org.xwiki.rendering.async.internal.AsyncRendererJob@6afabc7([uix, xwiki:Help.TipsPanel.WebHome, author, xwiki:XWiki.superadmin, locale, en, secureDocument, xwiki:Help.TipsPanel.WebHome, 31])] WARN  o.x.d.i.DocumentTitleDisplayer - Infinite recursion detected while displaying the title of [xwiki:Main.WebHome]. Using the document name as title. 
      

      The regression is apparently related to https://github.com/xwiki/xwiki-platform/commit/51e3b6713598fc8fc9c39d7d9b8c8dfc2672912b

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gdelhumeau Guillaume Delhumeau
                Reporter:
                surli Simon Urli
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: