I'm having trouble getting Coherence to run as a JCache provider
I get the following exception...
Exception in thread "main" javax.cache.CacheException: No CachingProviders have been configured
at javax.cache.Caching$CachingProviderRegistry.getCachingProvider(Caching.java:381)
at javax.cache.Caching$CachingProviderRegistry.getCachingProvider(Caching.java:351)
at javax.cache.Caching.getCachingProvider(Caching.java:142)
at com.craftedbytes.CacheExample.main(CacheExample.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
I have a simple pom.xml with the following...(the coherence jars are installed to my local .m2 repo and I can see them being picked up ok on the classpath)
<dependencies>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.0.0</version>
</dependency
<dependency>
<groupId>com.oracle.coherence</groupId>
<artifactId>coherence</artifactId>
<version>12.1.3</version>
</dependency>
<dependency>
<groupId>com.oracle.coherence</groupId>
<artifactId>coherence-jcache</artifactId>
<version>12.1.3</version>
</dependency>
</dependencies
And a simple main method....
// Acquire the default cache provider
CachingProvider cachingProvider = Caching.getCachingProvider();
// Acquire the default cache manager
CacheManager manager = cachingProvider.getCacheManager();
I also tried with explicitly setting the cache provider....
com.tangosol.coherence.jcache.CoherenceBasedCachingProvider
But for some reason that class doesn't appear to be in the coherence-jcache-12.1.3.jar I have.
FYI, I downloaded the coherence jars from http://www.oracle.com/technetwork/middleware/coherence/downloads/index.html
and used the installer.
Thanks
David.