[ http://issues.apache.org/jira/browse/NUTCH-280?page=all ]
Sami Siren closed NUTCH-280. ---------------------------- > url query causes NullPointerException > ------------------------------------- > > Key: NUTCH-280 > URL: http://issues.apache.org/jira/browse/NUTCH-280 > Project: Nutch > Issue Type: Bug > Components: searcher > Affects Versions: 0.8 > Reporter: Grant Glouser > Assigned To: Sami Siren > Fix For: 0.8 > > > 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
