ehcache program not running
-
23-06-2021 - |
Question
I am new to EHcache
. I recently installed EHcache-2.6.0
on my Ubuntu 12.04
system. I have been trying to run a simple cache put,get program in java, but it is giving me following error:
We couldn't load configuration data from the server at 'localhost:9510'; retrying. (Error: Connection refused.)
Can anybody please help me to fix this problem?
Thanks.
Solution
Ehcache when used as a single-JVM cache does not need to connect to a remote server.
So you should begin by coding a simple ehcahe (many documentation can be found on Google). When your single-JVM works, move to a distributed one.
Edit : here are some simple code examples : http://ehcache.org/documentation/code-samples
Quickly :
create a ehcache.xml containing the config of your caches.
Instanciate one CacheManager.
Use the CacheManager to retrieve one Cache.
Use this Cache to do put, get, etc...