当我尝试使用基于 Hazelcast 的 JCache 实现(即 JSR 107)时,我收到了一个奇怪的警告,如下所示(原始示例代码):
// Explicitly retrieve the Hazelcast backed javax.cache.spi.CachingProvider
CachingProvider cachingProvider = Caching.getCachingProvider(name);
// Retrieve the javax.cache.CacheManager
CacheManager cacheManager = cachingProvider.getCacheManager("com.hazelcast.cache.impl.HazelcastCachingProvider");
这是记录的消息:
oct. 30, 2014 5:17:59 PM com.hazelcast.cache.impl.HazelcastCachingProvider
WARNING: Could not load client CachingProvider! Fallback to server one... java.lang.ClassNotFoundException: com.hazelcast.client.cache.impl.HazelcastClientCachingProvider
为什么它试图加载HazelcastClientCachingProvider
我会要求com.hazelcast.cache.impl.HazelcastCachingProvider
。我是否使用了错误的 JCache 提供程序?