Mailing List Archive

PhraseQuery: NullPointerException
*This message was transferred with a trial version of CommuniGate(tm) Pro*

I thought I saw a post that delt with this problem previously, but I
couldn't find it in the archives. If it is a duplicate question I apologize.

I'm building a PhraseQuery and getting a random NullPointerException. It
doesn't occur with all phrases, but is consistent with respect to the ones
it does occur with. For example: "visual basic", "information systems", and
"project manager" always succeed. But other phrases like "general public",
"proven abilities", and "sql server" always fail. The stack trace is as
follows:

caught a class java.lang.NullPointerException with message: null
java.lang.NullPointerException
at org.apache.lucene.index.SegmentTermPositions.seek(Unknown Source)
at org.apache.lucene.index.SegmentTermDocs.seek(Unknown Source)
at org.apache.lucene.index.SegmentsTermDocs.termDocs(Unknown Source)
at org.apache.lucene.index.SegmentsTermDocs.next(Unknown Source)
at org.apache.lucene.search.PhrasePositions.next(Unknown Source)
at org.apache.lucene.search.PhraseScorer.score(Unknown Source)
at org.apache.lucene.search.IndexSearcher.search(Unknown Source)
at org.apache.lucene.search.Hits.getMoreDocs(Unknown Source)
at org.apache.lucene.search.Hits.<init>(Unknown Source)
at org.apache.lucene.search.Searcher.search(Unknown Source)
at org.apache.lucene.search.Searcher.search(Unknown Source)
at
com.jobwarehouse.lucene.search.JWPassiveResumeSearch.search(JWPassiveResumeS
earch.java:209)
at
com.jobwarehouse.lucene.search.JWPassiveResumeSearch.main(JWPassiveResumeSea
rch.java:280)

Thanks!
Jonathan Franzone


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: PhraseQuery: NullPointerException [ In reply to ]
1.2-rc3 seems to generate NPE if one or more of the words in
the search phrase are not present in the index.
Works as expected, no NPE, with 1.2-rc2.

If change method seek() in org.apache.lucene.index.SegmentTermPositions from

final void seek(TermInfo ti) throws IOException {
super.seek(ti);
proxStream.seek(ti.proxPointer);
}

to

final void seek(TermInfo ti) throws IOException {
super.seek(ti);
if (ti != null) {
proxStream.seek(ti.proxPointer);
}
}

the NPE goes away. But I don't know what is going on here so
this may well not be the correct solution.




--
Ian.
ian.lea@blackwell.co.uk


Jonathan Franzone wrote:
>
> *This message was transferred with a trial version of CommuniGate(tm) Pro*
>
> I thought I saw a post that delt with this problem previously, but I
> couldn't find it in the archives. If it is a duplicate question I apologize.
>
> I'm building a PhraseQuery and getting a random NullPointerException. It
> doesn't occur with all phrases, but is consistent with respect to the ones
> it does occur with. For example: "visual basic", "information systems", and
> "project manager" always succeed. But other phrases like "general public",
> "proven abilities", and "sql server" always fail. The stack trace is as
> follows:
>
> caught a class java.lang.NullPointerException with message: null
> java.lang.NullPointerException
> at org.apache.lucene.index.SegmentTermPositions.seek(Unknown Source)
> at org.apache.lucene.index.SegmentTermDocs.seek(Unknown Source)
> at org.apache.lucene.index.SegmentsTermDocs.termDocs(Unknown Source)
> at org.apache.lucene.index.SegmentsTermDocs.next(Unknown Source)
> at org.apache.lucene.search.PhrasePositions.next(Unknown Source)
> at org.apache.lucene.search.PhraseScorer.score(Unknown Source)
> at org.apache.lucene.search.IndexSearcher.search(Unknown Source)
> at org.apache.lucene.search.Hits.getMoreDocs(Unknown Source)
> at org.apache.lucene.search.Hits.<init>(Unknown Source)
> at org.apache.lucene.search.Searcher.search(Unknown Source)
> at org.apache.lucene.search.Searcher.search(Unknown Source)
> at
> com.jobwarehouse.lucene.search.JWPassiveResumeSearch.search(JWPassiveResumeS
> earch.java:209)
> at
> com.jobwarehouse.lucene.search.JWPassiveResumeSearch.main(JWPassiveResumeSea
> rch.java:280)
>
> Thanks!
> Jonathan Franzone

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
RE: PhraseQuery: NullPointerException [ In reply to ]
*This message was transferred with a trial version of CommuniGate(tm) Pro*

Thanks, I may just step back to 1.2-rc2 until they've fixed this. I'm in a
bit of a crunch and don't feel like building lucene myself. Anyway, thanks
again for the response!

-----Original Message-----
From: tril@ganymede.blackwell.co.uk
[mailto:tril@ganymede.blackwell.co.uk]On Behalf Of Ian Lea
Sent: Friday, February 08, 2002 6:08 AM
To: Lucene Users List
Subject: Re: PhraseQuery: NullPointerException

1.2-rc3 seems to generate NPE if one or more of the words in
the search phrase are not present in the index.
Works as expected, no NPE, with 1.2-rc2.

If change method seek() in org.apache.lucene.index.SegmentTermPositions from

final void seek(TermInfo ti) throws IOException {
super.seek(ti);
proxStream.seek(ti.proxPointer);
}

to

final void seek(TermInfo ti) throws IOException {
super.seek(ti);
if (ti != null) {
proxStream.seek(ti.proxPointer);
}
}

the NPE goes away. But I don't know what is going on here so
this may well not be the correct solution.




--
Ian.
ian.lea@blackwell.co.uk


Jonathan Franzone wrote:
>
> *This message was transferred with a trial version of CommuniGate(tm) Pro*
>
> I thought I saw a post that delt with this problem previously, but I
> couldn't find it in the archives. If it is a duplicate question I
apologize.
>
> I'm building a PhraseQuery and getting a random NullPointerException. It
> doesn't occur with all phrases, but is consistent with respect to the ones
> it does occur with. For example: "visual basic", "information systems",
and
> "project manager" always succeed. But other phrases like "general
public",
> "proven abilities", and "sql server" always fail. The stack trace is as
> follows:
>
> caught a class java.lang.NullPointerException with message: null
> java.lang.NullPointerException
> at org.apache.lucene.index.SegmentTermPositions.seek(Unknown
Source)
> at org.apache.lucene.index.SegmentTermDocs.seek(Unknown Source)
> at org.apache.lucene.index.SegmentsTermDocs.termDocs(Unknown
Source)
> at org.apache.lucene.index.SegmentsTermDocs.next(Unknown Source)
> at org.apache.lucene.search.PhrasePositions.next(Unknown Source)
> at org.apache.lucene.search.PhraseScorer.score(Unknown Source)
> at org.apache.lucene.search.IndexSearcher.search(Unknown Source)
> at org.apache.lucene.search.Hits.getMoreDocs(Unknown Source)
> at org.apache.lucene.search.Hits.<init>(Unknown Source)
> at org.apache.lucene.search.Searcher.search(Unknown Source)
> at org.apache.lucene.search.Searcher.search(Unknown Source)
> at
>
com.jobwarehouse.lucene.search.JWPassiveResumeSearch.search(JWPassiveResumeS
> earch.java:209)
> at
>
com.jobwarehouse.lucene.search.JWPassiveResumeSearch.main(JWPassiveResumeSea
> rch.java:280)
>
> Thanks!
> Jonathan Franzone

--
To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
RE: PhraseQuery: NullPointerException [ In reply to ]
This bug has been fixed. The fix will be in tonight's nightly build.

Doug

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
RE: PhraseQuery: NullPointerException [ In reply to ]
*This message was transferred with a trial version of CommuniGate(tm) Pro*

Thank you thank you thank you thank you!!!

-----Original Message-----
From: Doug Cutting [mailto:DCutting@grandcentral.com]
Sent: Friday, February 08, 2002 5:12 PM
To: 'Lucene Users List'
Subject: RE: PhraseQuery: NullPointerException


*This message was transferred with a trial version of CommuniGate(tm) Pro*
This bug has been fixed. The fix will be in tonight's nightly build.

Doug

--
To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>