Skip to content

EhCacheInterceptor initialized with null cache under high load #104

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?

Run the attached testcase. It illustrates the problem. Every time "GOT ONE!!" 
is printed to the console, the problem has manifested itself

What is the expected output? What do you see instead?

When using DefaultCacheResolverFactory with createCaches set to true in a high 
load scenario it can happen that multiple threads will try and create a non 
existing cache in parallel. In this case the EhCacheInterceptor should still be 
initialized properly but this is not always the case. We where seeing the 
following exception in the logs :

marketplace-server: java.lang.NullPointerException: null
marketplace-server:     at 
com.googlecode.ehcache.annotations.interceptor.EhCacheInterceptor.invokeCacheabl
e(EhCacheInterceptor.java:129) ~[ehcache-spring-annotations-1.2.0.jar:1.2.0]
marketplace-server:     at 
com.googlecode.ehcache.annotations.interceptor.EhCacheInterceptor.invoke(EhCache
Interceptor.java:81) ~[ehcache-spring-annotations-1.2.0.jar:1.2.0]
marketplace-server:     at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM
ethodInvocation.java:172) ~[spring-aop-3.1.3.RELEASE.jar:3.1.3.RELEASE]
marketplace-server:     at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.j
ava:202) ~[spring-aop-3.1.3.RELEASE.jar:3.1.3.RELEASE]
marketplace-server:     at 
$Proxy112.getNonNumericAndNumericAttributesForCategory(Unknown Source) ~[na:na]


What version of the product are you using? On what operating system?

We are using ehcache-spring-annotations-1.2.0. The attached code was tested on 
a macbook pro 2.6ghz intel core i7, 16gig, running OSX 10.8.5



Original issue reported on code.google.com by jkupe...@gmail.com on 4 Dec 2013 at 7:50

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions