使用mongodb作为infinispan缓存存储区的异常 [英] Exception using mongodb as infinispan cache store

查看:79
本文介绍了使用mongodb作为infinispan缓存存储区的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将MongoDb用作infinispan的缓存存储,以持久保存根据策略驱逐出的数据

I want to use MongoDb as cacche store for the infinispan to persist the data evicted according to policy

我正在发布引起异常的代码片段

i am posting the snippet of the code that is causing exception along with the exception

ConfigurationBuilder config = new ConfigurationBuilder();
MongoDBCacheStore strgBuilder = new MongoDBCacheStore();
ConfigurationBuilder b = new ConfigurationBuilder();
b.persistence()
 .addStore(MongoDBCacheStoreConfigurationBuilder.class)
 .host( "localhost" )
 .port( 27017 )
 .timeout( 1500 )
 .acknowledgment( 0 )
 .username( "" )
 .password( "" )
 .database( "infinispan_cachestore" )
 .collection( "entries" );
/* DefaultCacheManager manager=new DefaultCacheManager(b.build());
Cache ch=manager.getCache();
ch.put("username","sogani"); */

final Configuration configcache = b.build();
MongoDBCacheStoreConfiguration store = (MongoDBCacheStoreConfiguration) configcache.persistence().stores().get(0);

我得到的例外是

java.lang.NoSuchMethodException: org.infinispan.loaders.mongodb.configuration.MongoDBCacheStoreConfigurationBuilder.

任何指针都会有很大的帮助 谢谢.

Any pointer will be of a great help Thnx.

推荐答案

在Infinispan中采用了新的持久性API之后,MongoDB尚未更新.尝试使用Infinispan 5.2.7.Final(也许是5.3.0.Final),或尝试使用Adaptor52x.或者,甚至更好的是,尝试使用新的CacheWriter接口重新实现它并发布PR-现有代码应为您提供一些指导.

MongoDB was not updated after new persistence API was adopted in Infinispan. Try Infinispan 5.2.7.Final, maybe 5.3.0.Final or look into adaptor52x stuff. Or, even better, try to reimplement it using the new CacheWriter interface and issue a PR - the existing code should provide you some guidelines.

这篇关于使用mongodb作为infinispan缓存存储区的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆