Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Null pointer Exception when run search funtion
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
maivanha1610  
View profile  
 More options Feb 21 2011, 3:24 am
From: maivanha1610 <maivanha1...@gmail.com>
Date: Mon, 21 Feb 2011 00:24:13 -0800 (PST)
Local: Mon, Feb 21 2011 3:24 am
Subject: Null pointer Exception when run search funtion
Hi

I'm beginner, I'm running HelloWorldClass example, writer function is
run successfully but when I call search function then it fail and
throw exception.
my code:
                IndexReader reader = new HBaseIndexReader(tablePool,
tableName, primaryKeyField);
                IndexSearcher searcher = new IndexSearcher(reader);
                TopDocs docs = searcher.search(new TermQuery(new Term("content",
"plays")), 3);
                searcher.close();

when run, exception is thrown  in TopDocs docs = searcher.search(new
TermQuery(new Term("content", "plays")), 3);
here is exception:

Exception in thread "main" java.lang.NullPointerException
        at org.hbasene.index.HBaseTermPositions.seek(HBaseTermPositions.java:
161)
        at org.apache.lucene.index.IndexReader.termDocs(IndexReader.java:814)
        at org.apache.lucene.search.TermQuery
$TermWeight.scorer(TermQuery.java:74)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:
205)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:
168)
        at org.apache.lucene.search.Searcher.search(Searcher.java:98)
        at org.apache.lucene.search.Searcher.search(Searcher.java:108)
        at myTest.HelloWorldClass.main(HelloWorldClass.java:57)

After that, I prepare my search function to:
                HBaseIndexReader indexReader = new
HBaseIndexReader(tablePool, tableName, primaryKeyField);
                HBaseIndexSearcher indexSearcher = new
HBaseIndexSearcher(indexReader);
                TermQuery termQuery = new TermQuery(new Term("content", "plays"));
                //Sort sort = new Sort(new SortField("plays", SortField.STRING));
                TopDocs docs = indexSearcher.search(termQuery, 10);
                //TopDocs docs =
indexSearcher.search(termQuery.createWeight(indexSearcher), null, 25,
sort, false);
                indexSearcher.close();

and again, exception is thrown in TopDocs docs =
indexSearcher.search(termQuery, 10);
here is exception:
Exception in thread "main" java.lang.NullPointerException
        at org.hbasene.index.HBaseTermPositions.seek(HBaseTermPositions.java:
161)
        at org.apache.lucene.index.IndexReader.termDocs(IndexReader.java:814)
        at org.apache.lucene.search.TermQuery
$TermWeight.scorer(TermQuery.java:74)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:
205)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:
168)
        at org.apache.lucene.search.Searcher.search(Searcher.java:98)
        at org.apache.lucene.search.Searcher.search(Searcher.java:108)
        at myTest.HelloWorldClass.main(HelloWorldClass.java:64)

I'm using Hbase 0.20.6 and hadoop 0.20.2, zookeeper 3.3.2, lucene
3.0.1

Please tell me how to fix this problem

Thanks

Mai Van Ha


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
maivanha1610  
View profile  
 More options Feb 21 2011, 3:42 am
From: maivanha1610 <maivanha1...@gmail.com>
Date: Mon, 21 Feb 2011 00:42:09 -0800 (PST)
Local: Mon, Feb 21 2011 3:42 am
Subject: Null pointer Exception when run search funtion
Hi

I'm beginner, I'm running HelloWorldClass example, writer function is
run successfully but when I call search function then it fail and
throw exception.
my code:
                IndexReader reader = new
HBaseIndexReader(tablePool,tableName, primaryKeyField);
                IndexSearcher searcher = new IndexSearcher(reader);
                TopDocs docs = searcher.search(new TermQuery(new
Term("content","plays")), 3);
                searcher.close();

when run, exception is thrown  in TopDocs docs = searcher.search(new
TermQuery(new Term("content", "plays")), 3);
here is exception:

Exception in thread "main" java.lang.NullPointerException
        at
org.hbasene.index.HBaseTermPositions.seek(HBaseTermPositions.java:161)
        at
org.apache.lucene.index.IndexReader.termDocs(IndexReader.java:814)
        at org.apache.lucene.search.TermQuery
$TermWeight.scorer(TermQuery.java:74)
        at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:205)
        at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:168)
        at org.apache.lucene.search.Searcher.search(Searcher.java:98)
        at org.apache.lucene.search.Searcher.search(Searcher.java:108)
        at myTest.HelloWorldClass.main(HelloWorldClass.java:57)

After that, I prepare my search function to:
                HBaseIndexReader indexReader = new
HBaseIndexReader(tablePool, tableName, primaryKeyField);
                HBaseIndexSearcher indexSearcher = new
HBaseIndexSearcher(indexReader);
                TermQuery termQuery = new TermQuery(new
Term("content", "plays"));
                //Sort sort = new Sort(new SortField("plays",
SortField.STRING));
                TopDocs docs = indexSearcher.search(termQuery, 10);
                //TopDocs docs =
indexSearcher.search(termQuery.createWeight(indexSearcher), null, 25,
sort, false);
                indexSearcher.close();

and again, exception is thrown in TopDocs docs =
indexSearcher.search(termQuery, 10);
here is exception:
Exception in thread "main" java.lang.NullPointerException
        at
org.hbasene.index.HBaseTermPositions.seek(HBaseTermPositions.java:161)
        at
org.apache.lucene.index.IndexReader.termDocs(IndexReader.java:814)
        at org.apache.lucene.search.TermQuery
$TermWeight.scorer(TermQuery.java:74)
        at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:205)
        at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:168)
        at org.apache.lucene.search.Searcher.search(Searcher.java:98)
        at org.apache.lucene.search.Searcher.search(Searcher.java:108)
        at myTest.HelloWorldClass.main(HelloWorldClass.java:64)

I'm using Hbase 0.20.6 and hadoop 0.20.2, zookeeper 3.3.2, lucene
3.0.1

Please tell me how to fix this problem

Thanks

Mai Van Ha


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Amit Jaiswal  
View profile   Translate to Translated (View Original)
 More options Feb 21 2011, 3:50 am
From: Amit Jaiswal <amit.jais...@gmail.com>
Date: Mon, 21 Feb 2011 03:50:09 -0500
Local: Mon, Feb 21 2011 3:50 am
Subject: Re: Null pointer Exception when run search funtion
Hi,

The latest code in trunk is not stable. I had to use some hacks to
make it work. You can try to checkout an older version of hbasene by
date or contact the developers.

-amit


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
maivanha1610  
View profile  
 More options Feb 21 2011, 4:55 am
From: maivanha1610 <maivanha1...@gmail.com>
Date: Mon, 21 Feb 2011 01:55:15 -0800 (PST)
Local: Mon, Feb 21 2011 4:55 am
Subject: Re: Null pointer Exception when run search funtion
Hi

Thank for your reply,but please give me svn link to checkout older
version, I don't know where is it ! I find it int https://github.com/akkumar/hbasene
but I didn't see older version or where to view it.

Thanks

Mai Van Ha

On Feb 21, 3:50 pm, Amit Jaiswal <amit.jais...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Amit Jaiswal  
View profile  
 More options Feb 21 2011, 4:59 am
From: Amit Jaiswal <amit.jais...@gmail.com>
Date: Mon, 21 Feb 2011 04:59:20 -0500
Local: Mon, Feb 21 2011 4:59 am
Subject: Re: Null pointer Exception when run search funtion
There should be some option in git. (Sorry, I am myself not a git expert).

-amit


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
maivanha1610  
View profile  
 More options Feb 21 2011, 5:03 am
From: maivanha1610 <maivanha1...@gmail.com>
Date: Mon, 21 Feb 2011 02:03:59 -0800 (PST)
Local: Mon, Feb 21 2011 5:03 am
Subject: Re: Null pointer Exception when run search funtion
Hi

I saw some version of source code from link: https://github.com/akkumar/hbasene/commits/master
but I don't now which is best for me to run search function.
Could you help me!!

Thanks

Mai Van Ha

On Feb 21, 3:50 pm, Amit Jaiswal <amit.jais...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
maivanha1610  
View profile   Translate to Translated (View Original)
 More options Feb 23 2011, 2:31 am
From: maivanha1610 <maivanha1...@gmail.com>
Date: Tue, 22 Feb 2011 23:31:19 -0800 (PST)
Local: Wed, Feb 23 2011 2:31 am
Subject: Re: Null pointer Exception when run search funtion
Hi
Could you tell me how to hack it?
I've tried more than tens versions (from latest version) but they
didn't run and I see that not easy to understand source code to
prepare error.

Mai Van Ha

On Feb 21, 3:50 pm, Amit Jaiswal <amit.jais...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »