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

Scheduler Plugin uses the wrong class loader

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 8.2-rc-1, 7.4.5
    • 7.4.4
    • Scheduler
    • None
    • Unknown
    • N/A
    • N/A

    Description

      The scheduler plugin uses:

      Class.forName(object.getStringValue("jobClass")
      

      ...to instantiate job classes (when it's a java job). However, the result is that it ends up using the container's default class loader (that only looks in the WEB-INF/lib folder) instead of using the current thread's class loader (that is extended by XWiki to also look at extensions installed with Extension Manager).

      The solution, as suggested by tmortagne is to use the following instead:

      Class.forName(object.getStringValue("jobClass"), true, Thread.currentThread().getContextClassLoader()) 
      

      ...and explicitly specify that it should use the current thread's class loader.

      Attachments

        Activity

          People

            enygma Eduard Moraru
            enygma Eduard Moraru
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: