jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sreelakshmi Dokkara <Sreelakshmi.Dokk...@lntinfotech.com>
Subject Using Remote Cache
Date Tue, 20 Jun 2006 11:38:26 GMT
Hi!
I'm trying to use JCS Remote Cache auxillary for caching POJOs. I have 
some queries.
Can I have both the server and the client configuration in the same 
program as cache.ccf and remote,cache.ccf?

If yes,
Do I have to compulsorily use "remote.tomcat.on = true" in 
remote.cache.ccf?
Here are the remote.cache.ccf and cache.ccf files I'm using

remote.cache.ccf:
# Registry used to register and provide the 
# IRemoteCacheService service.
registry.host=localhost
registry.port=1102
# call back port to local caches.
remote.cache.service.port=1102
# cluster setting
remote.cluster.LocalClusterConsistency=true
#switching on the TOMCAT server
remote.tomcat.on=true

cache.ccf
# DEFAULT CACHE REGION 
jcs.default=DC,RC1
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache

# PRE-DEFINED CACHE REGIONS 
jcs.region.testCache1=DC,RC1
jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.testCache1.cacheattributes.MaxObjects=1
jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache


# AVAILABLE AUXILIARY CACHES 
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=${user.dir}
jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000000
jcs.auxiliary.DC.attributes.MaxKeySize=1000000
jcs.auxiliary.DC.attributes.MaxRecycleBinSize=5000
jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000

# Remote RMI Cache set up to failover
jcs.auxiliary.RC1=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RC1.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
jcs.auxiliary.RC1.attributes.FailoverServers=localhost:1102
jcs.auxiliary.RC1.attributes.LocalPort=1103
jcs.auxiliary.RC1.attributes.RemoveUponRemotePut=true
jcs.auxiliary.RC1.attributes.GetOnly=false

The above configuration is leading to following error log
Jun 20, 2006 4:56:12 PM 
org.apache.jcs.engine.control.CompositeCacheManager configure
INFO: Creating cache manager from config file: /cache.ccf
Jun 20, 2006 4:56:12 PM org.apache.jcs.utils.threadpool.ThreadPoolManager 
loadConfig
INFO: thread_pool.default PoolConfiguration = useBoundary = 
[true]boundarySize = [2000]maximumPoolSize = [150]minimumPoolSize = 
[4]keepAliveTime = [300000]whenBlockedPolicy = [RUN]startUpSize = [4]
Jun 20, 2006 4:56:12 PM 
org.apache.jcs.engine.control.CompositeCacheConfigurator 
setDefaultAuxValues
INFO: Setting default auxiliaries to DC,RC1
Jun 20, 2006 4:56:12 PM 
org.apache.jcs.engine.control.CompositeCacheConfigurator 
setDefaultCompositeCacheAttributes
INFO: setting defaultCompositeCacheAttributes to [ useLateral = true, 
useRemote = true, useDisk = true, maxObjs = 1, maxSpoolPerRun = -1 ]
Jun 20, 2006 4:56:12 PM 
org.apache.jcs.engine.control.CompositeCacheConfigurator 
parseElementAttributes
INFO: No special ElementAttribute class defined for key 
[jcs.default.elementattributes], using default class.
Jun 20, 2006 4:56:12 PM 
org.apache.jcs.engine.control.CompositeCacheConfigurator 
setDefaultElementAttributes
INFO: setting defaultElementAttributes to [ IS_LATERAL = true, IS_SPOOL = 
true, IS_REMOTE = true, IS_ETERNAL = true, MaxLifeSeconds = -1, IdleTime = 
-1, CreateTime = 1150802772536, LastAccessTime = 1150802772536, 
getTimeToLiveSeconds() = -1, createTime = 1150802772536 ]
Jun 20, 2006 4:56:12 PM 
org.apache.jcs.engine.control.CompositeCacheConfigurator 
parseElementAttributes
INFO: No special ElementAttribute class defined for key 
[jcs.region.testCache1.elementattributes], using default class.
Jun 20, 2006 4:56:12 PM org.apache.jcs.engine.memory.lru.LRUMemoryCache 
initialize
INFO: initialized LRUMemoryCache for testCache1
Jun 20, 2006 4:56:12 PM org.apache.jcs.engine.control.CompositeCache 
<init>
INFO: Constructed cache with name: testCache1
Jun 20, 2006 4:56:13 PM 
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache <init>
INFO: Cache file root directory: C:\EclipseForJava\JCSLab
Jun 20, 2006 4:56:13 PM 
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache initKeyMap
INFO: Set maxKeySize to: '1000000'
Jun 20, 2006 4:56:13 PM org.apache.jcs.auxiliary.disk.indexed.IndexedDisk 
reset
WARNING: Resetting data file
Jun 20, 2006 4:56:13 PM 
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache initRecycleBin
INFO: Set recycle max Size to MaxRecycleBinSize: '5000'
Jun 20, 2006 4:56:14 PM org.apache.jcs.auxiliary.remote.RemoteCacheManager 
<init>
SEVERE: 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(Unknown Source)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown 
Source)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
        at sun.rmi.server.UnicastRef.newCall(Unknown Source)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at java.rmi.Naming.lookup(Unknown Source)
        at org.apache.jcs.auxiliary.remote.RemoteCacheManager.<init>(
RemoteCacheManager.java:111)
        at org.apache.jcs.auxiliary.remote.RemoteCacheManager.getInstance(
RemoteCacheManager.java:293)
        at org.apache.jcs.auxiliary.remote.RemoteCacheFactory.createCache(
RemoteCacheFactory.java:105)
        at 
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseAuxiliary(
CompositeCacheConfigurator.java:551)
        at 
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(
CompositeCacheConfigurator.java:343)
        at 
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(
CompositeCacheConfigurator.java:264)
        at 
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegions(
CompositeCacheConfigurator.java:241)
        at 
org.apache.jcs.engine.control.CompositeCacheConfigurator.doConfigure(
CompositeCacheConfigurator.java:136)
        at org.apache.jcs.engine.control.CompositeCacheManager.configure(
CompositeCacheManager.java:311)
        at org.apache.jcs.engine.control.CompositeCacheManager.configure(
CompositeCacheManager.java:255)
        at org.apache.jcs.engine.control.CompositeCacheManager.configure(
CompositeCacheManager.java:242)
        at org.apache.jcs.engine.control.CompositeCacheManager.configure(
CompositeCacheManager.java:191)
        at 
org.apache.jcs.engine.control.CompositeCacheManager.getInstance(
CompositeCacheManager.java:119)
        at org.apache.jcs.JCS.ensureCacheManager(JCS.java:99)
        at org.apache.jcs.JCS.getInstance(JCS.java:64)
        at com.thales.src.Main.main(Main.java:21)
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at 
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown 
Source)
        at 
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown 
Source)
        ... 22 more
Jun 20, 2006 4:56:14 PM org.apache.jcs.auxiliary.remote.RemoteCacheManager 
addRemoteCacheListener
INFO: The remote cache is configured to receive events from the remote 
server.  We will register a listener.
Jun 20, 2006 4:56:14 PM org.apache.jcs.engine.CacheEventQueue destroy
INFO: Destroy was called after queue was destroyed.  Doing nothing.  Stats 
=  Cache Event Queue
Working = true
Alive = false
Empty = true
Size = 0
Jun 20, 2006 4:56:14 PM 
org.apache.jcs.engine.control.CompositeCacheConfigurator parseRegions
INFO: Parsed regions [testCache1]
Jun 20, 2006 4:56:14 PM 
org.apache.jcs.engine.control.CompositeCacheConfigurator doConfigure
INFO: Finished configuration in 2375 ms.
b4 put
Jun 20, 2006 4:56:14 PM org.apache.jcs.engine.CacheEventQueue put
INFO: Cache event queue created: CacheEventQueue [listenerId=-248495388, 
cacheName=testCache1]
after put
MARY
JOE
Jun 20, 2006 4:56:14 PM org.apache.jcs.engine.CacheEventQueue put
INFO: Cache event queue created: CacheEventQueue [listenerId=0, 
cacheName=testCache1]
Can someone tell me whether I'm on the right track? Why does the above 
exception occur?


______________________________________________________________________
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message