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

URLs created by mailsender plugin called from a scheduler script can have a wrong context path

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.3-rc-1, 3.2.1
    • 3.2, 3.3-milestone-2
    • Mail, Scheduler
    • None
    • Unknown

    Description

      This happens when having XWiki as the ROOT webapp.

      The scenario is the following :

      • Scheduler job calls mailsender.sendMailFromTemplate
      • mail sender creates a new ExternalServletURLFactory, initialized with the calling context, which has a XWikiServletRequestStub as request
      • URL factory initialization calls XWiki#getWebAppPath to get the context path
      • #getWebAppPath calls contextPath = context.getRequest().getContextPath(); which generates a NPE
      • ... NPE is caught and a wrong context path is computed from the context URL, base on context.getURL().getPath();

      For example, <host>/bin/bin/Sandbox/Test, when the servlet path is the standard one.

      Attachments

        Activity

          People

            jerome Jerome Velociter
            jerome Jerome Velociter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: