2016-09-16 4 views
0

Hi Ich benutze Apache in meiner Feder Anwendung zünden. Wenn eine Serviceanfrage mit gemacht wird Paramter das tut in der Datenbank existiert es löst eine AusnahmeApache Ignite nicht Cache mit Nullwert aktualisieren

@Override 
@Cacheable(value = "channel") 
public Channel getChannelByCode(long ChannelCode) { 
    Query<Channel> query = channelDao.createQuery(); 
    query.filter(Channel.mongoChannelCode, ChannelCode); 
    return channelDao.findOne(query); 
} 

wenn channelDao.findOne(query); kehrt null Ignite Null-Zeiger Ausnahme auslöst. Unten ist die Stapelverfolgung.

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) 

Antwort

2

Dieses bereits behoben und das Update wird in Ignite 1.8 enthalten sein: https://issues.apache.org/jira/browse/IGNITE-3634

+0

groß ... als Alternative ich bin mit @Cacheable (value = "Kanal", es sei denn = „#result = = null "). Können Sie eine andere/bessere Alternative vorschlagen? –

+0

Dadurch wird die Ausnahme entfernt, aber der 'null'-Wert wird weiterhin nicht zwischengespeichert. Dies bedeutet, dass Sie diese Methode beim nächsten Aufruf erneut aufrufen. Ich denke nicht, dass es mit 1.7 eine saubere Abhilfe gibt. –

+0

ok ... ich kann damit leben, bis 1.8 veröffentlicht wird. kannst du mir sagen, wann die Version 1.8 veröffentlicht wurde? –

Verwandte Themen