You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Level D <72...@qq.com> on 2016/05/12 09:12:23 UTC

NullPointerException When Use ReadThrough

Hi,


When I use readthrough to get a key neither existed in ignite cache nor in hbase, console shows nullpointerexception.



Is it nessary for hbase to have the record? In addition to this way,how can I avoid that exception?

Re: Re: NullPointerException When Use ReadThrough

Posted by vkulichenko <va...@gmail.com>.
Everything is right, except that the NPE happens in your code, before the
value is passed back to Ignite, so it doesn't even make an attempt to update
the cache. Can you break on this line with a debugger and check what is
actually null there?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/NullPointerException-When-Use-ReadThrough-tp4886p4994.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Re: NullPointerException When Use ReadThrough

Posted by Level D <72...@qq.com>.
Er...

In my opinion, readthrough synchronizes data from hbase to ignite cache. Even though readthrough doesn't get any data from hbase, it also synchronizes data.

As a result, nullpointerexception comes out.

As I mentioned before,  I use hbase without ignite to execute that line, console will  return a null value. But when I use ignite readthrough, console return a  nullpointerexception.

By the way, forgot to add one point. If the key queried is exsited in hbase, readthrough is good.


------------------ Original ------------------
From:  "vkulichenko";<va...@gmail.com>;
Date:  Sat, May 14, 2016 02:51 AM
To:  "user"<us...@ignite.apache.org>; 

Subject:  Re: Re: NullPointerException When Use ReadThrough



Hi,

This line has nothing to do with Ignite. What is null - hbaseBean or hTable?

Most likely there is an initialization issue and you should check the cache
store factory that you're using. It has to properly initialize HBase
connections when the store is created.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/NullPointerException-When-Use-ReadThrough-tp4886p4938.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Re: NullPointerException When Use ReadThrough

Posted by vkulichenko <va...@gmail.com>.
Hi,

This line has nothing to do with Ignite. What is null - hbaseBean or hTable?

Most likely there is an initialization issue and you should check the cache
store factory that you're using. It has to properly initialize HBase
connections when the store is created.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/NullPointerException-When-Use-ReadThrough-tp4886p4938.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: NullPointerException When Use ReadThrough

Posted by Level D <72...@qq.com>.
Yes, it's my code.


rs=hbaseBean.hTable.get(new Get(Bytes.toBytes(key)));

It's Hbase's api.


If I only use hbase without ignite to execute that line, console will return a null value. But when I use ignite readthrough, console return a nullpointerexception you have known.


I guess the really wrong place is ignite-core.


------------------ 原始邮件 ------------------
发件人: "Dmitriy Setrakyan";<ds...@apache.org>;
发送时间: 2016年5月13日(星期五) 下午3:06
收件人: "user"<us...@ignite.apache.org>; 

主题: Re: NullPointerException When Use ReadThrough



The stack trace shows that NPE comes from hbasetest.HbaseLoadCacheStore.load(HbaseLoadCacheStore.java:121), which is not an Ignite class.

Is this your code? Can you check what is null in this class on line 121?


D.

On Thu, May 12, 2016 at 11:43 PM, Level D <72...@qq.com> wrote:
Console shows :


[14:33:38,735][SEVERE][sys-#19%null%][GridPartitionedSingleGetFuture] Failed to get values from dht cache [fut=GridCompoundIdentityFuture [super=GridCompoundFuture [rdc=Collection reducer: [], flags=1, lsnrCalls=1, done=true, cancelled=false, err=class o.a.i.IgniteCheckedException: java.lang.NullPointerException, futs=[false, true]]]]
class org.apache.ignite.IgniteCheckedException: java.lang.NullPointerException
	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:309)
	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.load(GridCacheStoreManagerAdapter.java:265)
	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAllFromStore(GridCacheStoreManagerAdapter.java:398)
	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAll(GridCacheStoreManagerAdapter.java:364)
	at org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:1944)
	at org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:1942)
	at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6420)
	at org.apache.ignite.internal.processors.closure.GridClosureProcessor$2.body(GridClosureProcessor.java:929)
	at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: javax.cache.integration.CacheLoaderException: java.lang.NullPointerException
	... 12 more
Caused by: java.lang.NullPointerException
	at hbasetest.HbaseLoadCacheStore.load(HbaseLoadCacheStore.java:121)
	at hbasetest.HbaseLoadCacheStore.load(HbaseLoadCacheStore.java:25)
	at org.apache.ignite.internal.processors.cache.CacheStoreBalancingWrapper.load(CacheStoreBalancingWrapper.java:97)
	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:298)
	... 11 more


Line 121 in HbaseLoadCacheStore.java is rs=hbaseBean.hTable.get(new Get(Bytes.toBytes(key)));

In addition, that ket is neither existed in ignite cache nor in hbase.


Thanks for your help.

Re: NullPointerException When Use ReadThrough

Posted by Dmitriy Setrakyan <ds...@apache.org>.
The stack trace shows that NPE comes from
hbasetest.HbaseLoadCacheStore.load(HbaseLoadCacheStore.java:121), which is
not an Ignite class.

Is this your code? Can you check what is null in this class on line 121?

D.

On Thu, May 12, 2016 at 11:43 PM, Level D <72...@qq.com> wrote:

> Console shows :
>
> [14:33:38,735][SEVERE][sys-#19%null%][GridPartitionedSingleGetFuture]
> Failed to get values from dht cache [fut=GridCompoundIdentityFuture
> [super=GridCompoundFuture [rdc=Collection reducer: [], flags=1,
> lsnrCalls=1, done=true, cancelled=false, err=class
> o.a.i.IgniteCheckedException: java.lang.NullPointerException, futs=[false,
> true]]]]
> class org.apache.ignite.IgniteCheckedException:
> java.lang.NullPointerException
> at
> org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:309)
> at
> org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.load(GridCacheStoreManagerAdapter.java:265)
> at
> org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAllFromStore(GridCacheStoreManagerAdapter.java:398)
> at
> org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAll(GridCacheStoreManagerAdapter.java:364)
> at
> org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:1944)
> at
> org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:1942)
> at
> org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6420)
> at
> org.apache.ignite.internal.processors.closure.GridClosureProcessor$2.body(GridClosureProcessor.java:929)
> at
> org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: javax.cache.integration.CacheLoaderException:
> java.lang.NullPointerException
> ... 12 more
> Caused by: java.lang.NullPointerException
> at hbasetest.HbaseLoadCacheStore.load(HbaseLoadCacheStore.java:121)
> at hbasetest.HbaseLoadCacheStore.load(HbaseLoadCacheStore.java:25)
> at
> org.apache.ignite.internal.processors.cache.CacheStoreBalancingWrapper.load(CacheStoreBalancingWrapper.java:97)
> at
> org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:298)
> ... 11 more
>
> Line 121 in HbaseLoadCacheStore.java is rs=hbaseBean.hTable.get(new
> Get(Bytes.toBytes(key)));
>
> In addition, that ket is neither existed in ignite cache nor in hbase.
>
> Thanks for your help.
>
> ------------------ 原始邮件 ------------------
> *发件人:* "Dmitriy Setrakyan";<ds...@apache.org>;
> *发送时间:* 2016年5月13日(星期五) 上午10:59
> *收件人:* "user"<us...@ignite.apache.org>;
> *主题:* Re: NullPointerException When Use ReadThrough
>
> Can you please provide the stack trace?
>
> On Thu, May 12, 2016 at 2:12 AM, Level D <72...@qq.com> wrote:
>
>> Hi,
>>
>> When I use readthrough to get a key neither existed in ignite cache nor
>> in hbase, console shows nullpointerexception.
>>
>> Is it nessary for hbase to have the record? In addition to this way,how
>> can I avoid that exception?
>>
>
>

回复: NullPointerException When Use ReadThrough

Posted by Level D <72...@qq.com>.
Console shows :


[14:33:38,735][SEVERE][sys-#19%null%][GridPartitionedSingleGetFuture] Failed to get values from dht cache [fut=GridCompoundIdentityFuture [super=GridCompoundFuture [rdc=Collection reducer: [], flags=1, lsnrCalls=1, done=true, cancelled=false, err=class o.a.i.IgniteCheckedException: java.lang.NullPointerException, futs=[false, true]]]]
class org.apache.ignite.IgniteCheckedException: java.lang.NullPointerException
	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:309)
	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.load(GridCacheStoreManagerAdapter.java:265)
	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAllFromStore(GridCacheStoreManagerAdapter.java:398)
	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAll(GridCacheStoreManagerAdapter.java:364)
	at org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:1944)
	at org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:1942)
	at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6420)
	at org.apache.ignite.internal.processors.closure.GridClosureProcessor$2.body(GridClosureProcessor.java:929)
	at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: javax.cache.integration.CacheLoaderException: java.lang.NullPointerException
	... 12 more
Caused by: java.lang.NullPointerException
	at hbasetest.HbaseLoadCacheStore.load(HbaseLoadCacheStore.java:121)
	at hbasetest.HbaseLoadCacheStore.load(HbaseLoadCacheStore.java:25)
	at org.apache.ignite.internal.processors.cache.CacheStoreBalancingWrapper.load(CacheStoreBalancingWrapper.java:97)
	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:298)
	... 11 more


Line 121 in HbaseLoadCacheStore.java is rs=hbaseBean.hTable.get(new Get(Bytes.toBytes(key)));

In addition, that ket is neither existed in ignite cache nor in hbase.


Thanks for your help.


------------------ 原始邮件 ------------------
发件人: "Dmitriy Setrakyan";<ds...@apache.org>;
发送时间: 2016年5月13日(星期五) 上午10:59
收件人: "user"<us...@ignite.apache.org>; 

主题: Re: NullPointerException When Use ReadThrough



Can you please provide the stack trace?

On Thu, May 12, 2016 at 2:12 AM, Level D <72...@qq.com> wrote:
Hi,


When I use readthrough to get a key neither existed in ignite cache nor in hbase, console shows nullpointerexception.



Is it nessary for hbase to have the record? In addition to this way,how can I avoid that exception?

Re: NullPointerException When Use ReadThrough

Posted by Dmitriy Setrakyan <ds...@apache.org>.
Can you please provide the stack trace?

On Thu, May 12, 2016 at 2:12 AM, Level D <72...@qq.com> wrote:

> Hi,
>
> When I use readthrough to get a key neither existed in ignite cache nor in
> hbase, console shows nullpointerexception.
>
> Is it nessary for hbase to have the record? In addition to this way,how
> can I avoid that exception?
>