您好,我在我的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抛出null指针异常。下面是堆栈跟踪。
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)发布于 2016-09-18 02:15:07
这个问题已经修复了,这个修复将包含在Ignite1.8中:https://issues.apache.org/jira/browse/IGNITE-3634
https://stackoverflow.com/questions/39534249
复制相似问题