Uploaded image for project: 'Nutch'
  1. Nutch
  2. NUTCH-142

NutchConf should use the thread context classloader

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.7.2, 0.8
    • Component/s: None
    • Labels:
      None

      Description

      Right now NutchConf uses it's own static classloader which is evil in a J2EE scenario.

      This is simply fixed. Line 52:

      private ClassLoader classLoader = NutchConf.class.getClassLoader();

      Should be:

      private ClassLoader classLoader = Thread.currentThread().getContextClassLoader();

      This means no matter where Nutch classes are loaded from, it will use the correct J2EE classloader to try to find configuration files (ie from WEB-INF/classes).

        Activity

        Hide
        pkosiorowski Piotr Kosiorowski added a comment -

        Thanks. Fixed in 0.7 branch. Left open to fix it in trunk after cleaning trunk JUnit test problems (in next few days).

        Show
        pkosiorowski Piotr Kosiorowski added a comment - Thanks. Fixed in 0.7 branch. Left open to fix it in trunk after cleaning trunk JUnit test problems (in next few days).

          People

          • Assignee:
            Unassigned
            Reporter:
            mike@atlassian.com Mike Cannon-Brookes
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development