gpt4 book ai didi

java - Apache Ignite 不更新具有空值的缓存

转载 作者:行者123 更新时间:2023-12-01 21:18:28 25 4
gpt4 key购买 nike

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

@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抛出空指针异常。下面是堆栈跟踪。

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)

最佳答案

此问题已修复,修复将包含在 Ignite 1.8 中:https://issues.apache.org/jira/browse/IGNITE-3634

关于java - Apache Ignite 不更新具有空值的缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39534249/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com