Hi there,
I try to use JCS for my web application. I reviewed the project document, and
found it doesn't specify how to start up a remote cache server in my Local PC.
I wrote a simple testing program TestJCS.java. I got following error when I
run TestJCS:
------------------------------------------------------------------------------------------------
2006-06-19 15:48:18,326 [main] ERROR
org.apache.jcs.auxiliary.remote.RemoteCacheManager - Problem finding server at
[//localhost:1102/org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService]
java.rmi.ConnectException: Connection refused to host: localhost; nested
exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at
org.apache.jcs.auxiliary.remote.RemoteCacheManager.<init>(RemoteCacheManager.java:111)
here is my cache.ccf file:
------------------------------------
##################################################################
# DEFAULT CACHE REGION
# sets the default aux value for any non configured caches
#################################################################
#jcs.default=DC
jcs.default=DC,RFailover
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=0
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.default.elementattributes.IsEternal=false
jcs.default.elementattributes.MaxLifeSeconds=3600
jcs.default.elementattributes.IdleTime=1800
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=true
jcs.default.elementattributes.IsLateral=true
######################################################
# CACHE REGIONS AVAILABLE
# Regions preconfigured for caching
#####################################################
#jcs.region.bookCache=DC
jcs.region.bookCache=DC,RFailover
jcs.region.bookCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.bookCache.cacheattributes.MaxObjects=0
jcs.region.bookCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.bookCache.elementattributes.IsEternal=false
jcs.region.bookCache.elementattributes.MaxLifeSeconds=7200
jcs.region.bookCache.elementattributes.IdleTime=1800
jcs.region.bookCache.elementattributes.IsSpool=true
jcs.region.bookCache.elementattributes.IsRemote=true
jcs.region.bookCache.elementattributes.IsLateral=true
############################################################################
# AUXILIARY CACHES AVAILABLE
# Primary Disk Cache -- faster than the rest because of memory key storage
############################################################################
jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=C:\\Temp\\JCS_cache
jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000
jcs.auxiliary.DC.attributes.MaxKeySize=10000
jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000
jcs.auxiliary.DC.attributes.MaxRecycleBinSize=7500
#######################################
# Remote RMI Cache set up to failover
#######################################
jcs.auxiliary.RFailover=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RFailover.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
jcs.auxiliary.RFailover.attributes.RemoteTypeName=LOCAL
jcs.auxiliary.RFailover.attributes.FailoverServers=localhost:1102,localhost:1103
jcs.auxiliary.RFailover.attributes.GetOnly=false
and here is remote.cache.ccf file:
-----------------------------------------------
##############################################################
################## REMOTE SERVER CONFIG RS1 #################
# Registry used to register and provide the IRmiCacheService service.
registry.host=localhost
registry.port=1102
# call back port to local caches.
remote.cache.service.port=1102
# cluster setting
remote.cluster.LocalClusterConsistency=true
# RS2 SERVER to update for clustering
jcs.auxiliary.RCluster=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RCluster.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
#jcs.auxiliary.RCluster.attributes.RemoteTypeName=CLUSTER
jcs.auxiliary.RCluster.attributes.RemoteTypeName=LOCAL
jcs.auxiliary.RCluster.attributes.RemoveUponRemotePut=false
jcs.auxiliary.RCluster.attributes.ClusterServers=localhost:1102
jcs.auxiliary.RCluster.attributes.GetOnly=false
jcs.auxiliary.RCluster.attributes.LocalClusterConsistency=true
This is the first time I used JCS. Could you please tell me how to start up
Remot Cache Server in my local PC. Many thanks,
Lucy
---------------------------------
Yahoo! Sports Fantasy Football 06 - Go with the leader. Start your league
today!