Comments (5)
I wrote this small test:
javax.cache.CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
CacheConfiguration cacheConfiguration = new CacheConfiguration();
cacheConfiguration.setTimeToLiveSeconds(60 * 60 * 24 * 365 * 10);
cacheConfiguration.setTimeToIdleSeconds(60 * 60 * 24 * 365 * 10);
JCacheConfiguration jCacheConfiguration = new JCacheConfiguration(cacheConfiguration);
javax.cache.Cache cache = cacheManager.createCache("boo", jCacheConfiguration);
cache.put("key", "Value");
assertThat(cache.get("key"), is((Object) "Value"));
And nothing fails... Not sure what NPE you see @igmar , could you share it?
from ehcache-jcache.
I'll check when I get back from holiday. No usable laptop with me.
from ehcache-jcache.
To bring this back up :
Error in custom provider, java.lang.NullPointerException
at com.bm.common.cache.CacheModule$1.configure(CacheModule.java:78) (via modules: com.google.inject.util.Modules$OverrideModule -> com.bm.common.cache.CacheModule -> com.bm.common.cache.CacheModule$1)
at com.bm.common.cache.CacheModule$1.configure(CacheModule.java:78) (via modules: com.google.inject.util.Modules$OverrideModule -> com.bm.common.cache.CacheModule -> com.bm.common.cache.CacheModule$1)
while locating javax.cache.Cache annotated with @com.bm.common.cache.ehcache.EHCache(value=games)
for field at cache.CacheTest.cache(CacheTest.java:40)
while locating cache.CacheTest
1 error
at com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:482)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:67)
at com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984)
at cache.CacheTest.cacheEmpty(CacheTest.java:69)
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:483)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
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:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.NullPointerException
at org.ehcache.jcache.JCacheConfiguration.(JCacheConfiguration.java:67)
at org.ehcache.jcache.JCacheConfiguration.(JCacheConfiguration.java:124)
at org.ehcache.jcache.JCacheManager.createCache(JCacheManager.java:110)
at com.bm.common.cache.ehcache.EHCacheProvider.get(EHCacheProvider.java:41)
at com.bm.common.cache.ehcache.EHCacheProvider.get(EHCacheProvider.java:18)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.ExposedKeyFactory.get(ExposedKeyFactory.java:54)
at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:54)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132)
at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:93)
at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:80)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:80)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:62)
... 30 more
from ehcache-jcache.
I'll also do some diving, to see if I can figure out what causes this. It's a DI usage, in the Play framework in case it's relevant.
from ehcache-jcache.
It blows up in JCacheConfiguration.java :
Factory expiryPolicyFactory = cConfiguration.getExpiryPolicyFactory();
this.expiryPolicy = expiryPolicyFactory.create();
expiryPolicyFactory is null -> kaboom. No idea yet as to why.
from ehcache-jcache.
Related Issues (20)
- cache-annotations-cdi: java.lang.IllegalArgumentException: cacheValueParameter cannot be null HOT 1
- Update deps to latest versions
- Perform release of 1.0.0 to maven central HOT 1
- Expiration configured in ehcache.xml in not honoured HOT 8
- CacheLoaderException when reading from cache and no loader factory is specified HOT 6
- Default configuration in ehcache.xml is not used on created JCache instances HOT 3
- Use defaultCache to read default values for 107 unspecified props HOT 1
- JCacheStatMXBean.clear() clears the Cache?! HOT 1
- Could not create a cache named "default" through the JSR-107 API HOT 2
- Updating cache with EntryProcessor does not update HOT 2
- Support EHCache 2.4/2.6? HOT 4
- JCacheConfiguration ignores eternal flag if configured using ehcache.xml HOT 13
- Race Condition in JCacheManager between createCache() and getCache() HOT 5
- PR #45 introduced a failure
- Read configuration from file path
- ExpiryPolicy on existing caches lost after calling getCache on non-existing cache HOT 3
- Source files without license headers
- Potential Unreleased Lock
- getCache(cacheName, keyType, valueType) doesn't work for pre-configured cache HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ehcache-jcache.