首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Apache Ignite不使用空值更新缓存

Apache Ignite不使用空值更新缓存
EN

Stack Overflow用户
提问于 2016-09-16 22:42:34
回答 1查看 1.3K关注 0票数 0

您好,我在我的spring应用程序中使用apache ignite。当使用数据库中不存在的参数发出服务请求时,它会抛出异常

代码语言:javascript
复制
@Override
@Cacheable(value = "channel")
public Channel getChannelByCode(long ChannelCode) {
    Query<Channel> query = channelDao.createQuery();
    query.filter(Channel.mongoChannelCode, ChannelCode);
    return channelDao.findOne(query);
}

channelDao.findOne(query);返回null时,ignite抛出null指针异常。下面是堆栈跟踪。

代码语言:javascript
复制
threw exception [Request processing failed; nested exception is java.lang.NullPointerException: Ouch! Argument cannot be null: val] with root cause
java.lang.NullPointerException: Ouch! Argument cannot be null: val
    at org.apache.ignite.internal.util.GridArgumentCheck.notNull(GridArgumentCheck.java:48)
    at org.apache.ignite.internal.util.GridArgumentCheck.notNull(GridArgumentCheck.java:61)
    at org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.putAsync0(GridDhtAtomicCache.java:481)
    at org.apache.ignite.internal.processors.cache.GridCacheAdapter.putAsync(GridCacheAdapter.java:2541)
    at org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.put(GridDhtAtomicCache.java:460)
    at org.apache.ignite.internal.processors.cache.GridCacheAdapter.put(GridCacheAdapter.java:2215)
    at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.put(IgniteCacheProxy.java:1214)
    at org.apache.ignite.cache.spring.SpringCache.put(SpringCache.java:71)
    at org.springframework.cache.interceptor.AbstractCacheInvoker.doPut(AbstractCacheInvoker.java:82)
    at org.springframework.cache.interceptor.CacheAspectSupport$CachePutRequest.apply(CacheAspectSupport.java:626)
    at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:340)
    at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:281)
    at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
    at com.sun.proxy.$Proxy171.getChannelByCode(Unknown Source)
    at in.til.tp.commonpage.controller.BadgeController.getUserBadges(BadgeController.java:497)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
EN

回答 1

Stack Overflow用户

发布于 2016-09-18 02:15:07

这个问题已经修复了,这个修复将包含在Ignite1.8中:https://issues.apache.org/jira/browse/IGNITE-3634

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39534249

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档