Re: Null Pointer exception in AnalyzerFactory?

2006-03-13 Thread Chris Mattmann
Thanks Jerome! :-)

Cheers,
  Chris



On 3/13/06 4:02 PM, "Jérôme Charron" <[EMAIL PROTECTED]> wrote:

>>   I updated to the latest SVN revision (385691) today, and I am now seeing
>> a
>> Null Pointer exception in the AnalyzerFactory.java class.
> 
> Fixed (r385702). Thanks Chris.
> 
> 
>> NOTE: not sure if returning null is the right thing to do here, but hey,
>> at
>> least it made my crawl finish! :-)
> 
> It is the right thing to do.
> 
> Cheers,
> 
> Jérôme
> 
> --
> http://motrech.free.fr/
> http://www.frutch.org/

__
Chris A. Mattmann
[EMAIL PROTECTED]
Staff Member
Modeling and Data Management Systems Section (387)
Data Management Systems and Technologies Group

_
Jet Propulsion LaboratoryPasadena, CA
Office: 171-266BMailstop:  171-246
___

Disclaimer:  The opinions presented within are my own and do not reflect
those of either NASA, JPL, or the California Institute of Technology.




Re: Null Pointer exception in AnalyzerFactory?

2006-03-13 Thread Jérôme Charron
>   I updated to the latest SVN revision (385691) today, and I am now seeing
> a
> Null Pointer exception in the AnalyzerFactory.java class.

Fixed (r385702). Thanks Chris.


> NOTE: not sure if returning null is the right thing to do here, but hey,
> at
> least it made my crawl finish! :-)

It is the right thing to do.

Cheers,

Jérôme

--
http://motrech.free.fr/
http://www.frutch.org/


Null Pointer exception in AnalyzerFactory?

2006-03-13 Thread Chris Mattmann
Hi Folks,

  I updated to the latest SVN revision (385691) today, and I am now seeing a
Null Pointer exception in the AnalyzerFactory.java class. It seems that in
some cases, the method:

  private Extension getExtension(String lang) { Extension extension =
(Extension) this.conf.getObject(lang);if (extension == null) {
extension = findExtension(lang);  if (extension != null) {
this.conf.setObject(lang, extension);  }}return extension;  }


Has a null "lang" parameter passed to it, which causes a NullPointer
exception at line: 81 in
src/java/org/apache/nutch/analyzer/AnalyzerFactory.java

I found that if I checked for null in the lang variable, and returned null
if lang == null, that my crawl finished. Here is a small patch that will fix
the crawl:

Index: 
/Users/mattmann/src/nutch/src/java/org/apache/nutch/analysis/AnalyzerFactory
.java ===
--- 
/Users/mattmann/src/nutch/src/java/org/apache/nutch/analysis/AnalyzerFactory
.java(revision 385691) +++
/Users/mattmann/src/nutch/src/java/org/apache/nutch/analysis/AnalyzerFactory
.java(working copy) @@ -78,14 +78,19 @@private Extension
getExtension(String lang) { -Extension extension = (Extension)
this.conf.getObject(lang); -if (extension == null) { -  extension =
findExtension(lang); -  if (extension != null) { -
this.conf.setObject(lang, extension); -  } -} -return extension;
+if(lang == null){ +return null; +} +else{ +
Extension extension = (Extension) this.conf.getObject(lang); +if
(extension == null) { +  extension = findExtension(lang); +
if (extension != null) { +this.conf.setObject(lang, extension);
+  } +} +return extension;+}   }
private Extension findExtension(String lang) {


NOTE: not sure if returning null is the right thing to do here, but hey, at
least it made my crawl finish! :-)

Cheers,
  Chris



__
Chris A. Mattmann
[EMAIL PROTECTED]
Staff Member
Modeling and Data Management Systems Section (387)
Data Management Systems and Technologies Group

_
Jet Propulsion LaboratoryPasadena, CA
Office: 171-266BMailstop:  171-246

___

Disclaimer:  The opinions presented within are my own and do not reflect
those of either NASA, JPL, or the California Institute of Technology.



Re: AnalyzerFactory

2006-03-13 Thread Doug Cutting

Jérôme Charron wrote:

It seems that the usage of AnalyzerFactory was removed while porting Indexer
to map/reduce.
(AnalyzerFactory is no more called in trunk code)
Is it intentional?
(if no, I have a patch that I can commit, so thanks to confirm)


It was not intentional.  Thanks for fixing this!

Doug


AnalyzerFactory

2006-03-10 Thread Jérôme Charron
It seems that the usage of AnalyzerFactory was removed while porting Indexer
to map/reduce.
(AnalyzerFactory is no more called in trunk code)
Is it intentional?
(if no, I have a patch that I can commit, so thanks to confirm)

Jérôme

--
http://motrech.free.fr/
http://www.frutch.org/