[ http://issues.apache.org/jira/browse/NUTCH-280?page=all ]

Grant Glouser updated NUTCH-280:
--------------------------------

      Component: searcher
        Summary: url query causes NullPointerException  (was: url query causes 
Null)
    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;
   }
 

        Version: 0.8-dev

> url query causes NullPointerException
> -------------------------------------
>
>          Key: NUTCH-280
>          URL: http://issues.apache.org/jira/browse/NUTCH-280
>      Project: Nutch
>         Type: Bug

>   Components: searcher
>     Versions: 0.8-dev
>     Reporter: Grant Glouser

>
> 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;
>    }
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nutch-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nutch-developers

Reply via email to