我正在尝试实现 Dynacache CacheProvider 但遇到问题。这是我所做的:
- 我的 Dynacache CacheProvider 实现 jar 位于 D:\IBM\WebSphere85\AppServer\lib 下
- 我已使用正确的 CacheProvider 实现类将 com.ibm.ws.cache.CacheConfig.cacheProviderName 配置为 JVM 定制属性。
- 在 D:\IBM\WebSphere85\AppServer\properties 下创建了 cacheinstance.properties,并使用相关设置(包括 com.ibm.ws.cache.CacheConfig.cacheProviderName 正确的类名称值)。
- 我的 cacheinstance.properties 也是 Dynacache CacheProvider 实现 jar 的一部分。
- 我已将对象缓存实例配置为具有新的动态缓存。它还将 com.ibm.ws.cache.CacheConfig.cacheProviderName 作为定制系统属性。
- 我的应用程序使用以下内容来访问缓存:
代码:
Properties props = new Properties();
props.put("com.ibm.ws.cache.CacheConfig.cacheProviderName","com.myCacheProvider");
map = (DistributedObjectCache)DistributedObjectCacheFactory.getMap("mycache",props);
当应用程序尝试访问 DynaCache 时,我收到以下信息:
[9/18/12 10:10:52:917 EDT] 00000050 ServerCache E DYNA1066E: Unable to initialize the cache provider "com.myCacheProvider". The Dynamic cache will be used to create the cache instance "default" instead of the configured cache provider.
[9/18/12 10:10:52:919 EDT] 00000050 ServerCache E ENGLISH ONLY MESSAGE: cacheProvider is null. Check for the cache provider libraries
[9/18/12 10:10:52:920 EDT] 00000050 ServerCache I DYNA1001I: WebSphere Dynamic Cache instance named default initialized successfully.
我使用的是 WAS 8.5。
有什么想法以及如何调试吗?
最佳答案
盖伊,
我会打开 Dyna 缓存跟踪来查看发生此错误的原因
跟踪字符串: com.ibm.ws.cache.=all:com.ibm.ws.drs.=all
这应该为我们提供有关正在发生的事情的线索,并且根据我们从跟踪中看到的内容,将为我们提供下一步该做什么的信息。
HTH
关于caching - 如何配置Dynacache CacheProvider?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12550653/