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

url query causes NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8
    • 0.8
    • None
    • None

    Description

      A search such as "url:java.sun.com" causes a NullPointerException.
      The cause is setConf() in URLQueryFilter (in the query-url plugin) that overrides FieldQueryFilter.setConf(), but does not call super.setConf(). The superclass, FieldQueryFilter, depends on setConf in order to initialize its commonGrams. When FieldQueryFilter tries to access commonGrams later on, it throws a NullPointerException.
      This bug only affects phrase URL queries, so a simple URL query like url:sun would not hit it.

      Here is a simple patch which fixes this problem. An alternative would be to remove all configuration fields and methods from URLQueryFilter since it does not use them.

      Index: src/plugin/query-url/src/java/org/apache/nutch/searcher/url/URLQueryFilter.java
      ===================================================================
      — src/plugin/query-url/src/java/org/apache/nutch/searcher/url/URLQueryFilter.java (revision 1260)
      +++ src/plugin/query-url/src/java/org/apache/nutch/searcher/url/URLQueryFilter.java (working copy)
      @@ -31,6 +31,7 @@
      }

      public void setConf(Configuration conf)

      { + super.setConf(conf); this.conf = conf; }

      Attachments

        Activity

          People

            siren Sami Siren
            gglouser Grant Glouser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: