ehcache / ehcache-jcache

The Ehcache 2.x implementation of JSR107 (JCACHE)
Other
91 stars 48 forks source link

cache-annotations-cdi: java.lang.IllegalArgumentException: cacheValueParameter cannot be null #22

Closed doubble closed 10 years ago

doubble commented 10 years ago

Hi,

using following artefacts

    <dependency>
        <groupId>org.ehcache</groupId>
        <artifactId>jcache</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </dependency>

    <dependency>
        <groupId>org.jsr107.ri</groupId>
        <artifactId>cache-annotations-ri-cdi</artifactId>
        <version>1.0.0</version>
    </dependency>

I get the following Exception when returning null from an @CachePut(cacheName = CacheNames.USER_DAO_CACHE)

java.lang.IllegalArgumentException: cacheValueParameter cannot be null 2014-05-07 15:24:11.669231+00:00 app web.1 - - at org.jsr107.ri.annotations.CachePutMethodDetails.(CachePutMethodDetails.java:49) 2014-05-07 15:24:11.669233+00:00 app web.1 - - at org.jsr107.ri.annotations.AbstractCacheLookupUtil.createCachePutMethodDetails(AbstractCacheLookupUtil.java:332) 2014-05-07 15:24:11.669235+00:00 app web.1 - - at org.jsr107.ri.annotations.AbstractCacheLookupUtil.getMethodDetails(AbstractCacheLookupUtil.java:193) 2014-05-07 15:24:11.669236+00:00 app web.1 - - at org.jsr107.ri.annotations.AbstractCacheLookupUtil.getCacheKeyInvocationContext(AbstractCacheLookupUtil.java:72) 2014-05-07 15:24:11.669238+00:00 app web.1 - - at org.jsr107.ri.annotations.AbstractCachePutInterceptor.cachePut(AbstractCachePutInterceptor.java:48) 2014-05-07 15:24:11.669239+00:00 app web.1 - - at org.jsr107.ri.annotations.cdi.CachePutInterceptor.cachePut(CachePutInterceptor.java:51) 2014-05-07 15:24:11.669241+00:00 app web.1 - - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2014-05-07 15:24:11.669243+00:00 app web.1 - - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 2014-05-07 15:24:11.669244+00:00 app web.1 - - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2014-05-07 15:24:11.669246+00:00 app web.1 - - at java.lang.reflect.Method.invoke(Method.java:606) 2014-05-07 15:24:11.669247+00:00 app web.1 - - at org.jboss.weld.interceptor.proxy.SimpleMethodInvocation.invoke(SimpleMethodInvocation.java:30) 2014-05-07 15:24:11.669249+00:00 app web.1 - - at org.jboss.weld.interceptor.proxy.SimpleInterceptionChain.invokeNextInterceptor(SimpleInterceptionChain.java:69) 2014-05-07 15:24:11.669250+00:00 app web.1 - - at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:112) 2014-05-07 15:24:11.669252+00:00 app web.1 - - at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:88) 2014-05-07 15:24:11.669254+00:00 app web.1 - - at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:55) 2014-05-07 15:24:11.669255+00:00 app web.1 - - at org.remedia.foxydeal.clickserver.persistence.domain.UserDAO$Proxy$_$$WeldSubclass.get(UserDAO$Proxy$$$_WeldSubclass.java)

doubble commented 10 years ago

Sorry, mistakenly used CachePut instead of CacheResult annotation.