jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Smuts <asm...@yahoo.com>
Subject Re: Using Remote Cache
Date Tue, 20 Jun 2006 13:40:54 GMT

> Hi!
> I'm trying to use JCS Remote Cache auxiliary 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?
> 

I'm not sure what you are asking.  Are you aksing if
you can run the remote cache server and its client in
the same vm?  If so, the answer is why woudl you want
to?  The server sits on top of the cache.  The server
is unaware of anything done to the cache directly.  If
you have 4 clients connected to a server S, and you
put something into the cache that is behind S, then S
will not know about the put.  Hence, S cannot notify
the 4 clients.  However, S will be able to retreive
that data, since it is in the cache.  

Just run the server as a standalone application.  I
run it inside a tomcat server, using the startup
servlet which is in the remote cache server package.

The configuration option "remote.tomcat.on" has no
effect.  We no longer embed Tomcat.

Aaron

> 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(
> 
=== message truncated ===


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Mime
View raw message