ehcache程序没有运行

时间:2012-07-30 09:53:53

标签: java ehcache terracotta

我是EHcache的新手。我最近在EHcache-2.6.0系统上安装了Ubuntu 12.04。我一直在尝试运行一个简单的缓存put,在java中获取程序,但它给了我以下错误:  We couldn't load configuration data from the server at 'localhost:9510'; retrying. (Error: Connection refused.) 有人可以帮我解决这个问题吗? 感谢。

1 个答案:

答案 0 :(得分:0)

当用作单JVM缓存时,Ehcache不需要连接到远程服务器。

所以你应该首先编写一个简单的ehcahe(可以在Google上找到许多文档)。 当您的单JVM工作时,移动到分布式JVM。

编辑: 这里有一些简单的代码示例:http://ehcache.org/documentation/code-samples

很快:

  • 创建一个包含缓存配置的ehcache.xml。

  • Instanciate one CacheManager。

  • 使用CacheManager检索一个缓存。

  • 使用此缓存执行put,get等...

相关问题