jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Rasmussen <rasmus...@2e-systems.com>
Subject RE: Remote Auxiliary Cache
Date Wed, 13 Jul 2005 10:22:29 GMT
Hi again,

sorry, that was too fast a succes message from me, didn't
look properly in the first place...

Whenever I try starting the script like suggested
I keep getting the same error message:


Exception in thread "main" java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:365)
at java.util.Properties.load(Properties.java:293)
at org.apache.jcs.engine.control.CompositeCacheManager.configure
(CompositeCacheManager.java:168)
at
org.apache.jcs.auxiliary.remote.server.RemoteCacheServer.createCacheManager(RemoteCacheServer.java:157)
at org.apache.jcs.auxiliary.remote.server.RemoteCacheServer.init
(RemoteCacheServer.java:127)
at
org.apache.jcs.auxiliary.remote.server.RemoteCacheServer.<init>(RemoteCacheServer.java:109)
at
org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory.startup
(RemoteCacheServerFactory.java:115)
at org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory.main
(RemoteCacheServerFactory.java:287)


It seems though after extensive (I mean extensive) debugging
efforts that the remote.cache.ccf file is for some reason
simply not read. It's found but not read.
Do you know this problem. We've tried literally everything
(me and an experienced collegue of mine) eventually getting
nowhere.
Even if we change the name of the file to something which
we know doesn't exists (say to 'remote.cache.cctf') 
we still get the same two messages:

"Creating cache manager from config file: /home/trasmussen/jcs-
andrew/config/remote.cache.cctf"

and 

Error loading remote properties, for file name [/home/trasmussen/jcs-
andrew/config/remote.cache.cctf]

So it seems to be something preliminary thing. It's not coming
from the start script. We tried modifying nearly every possible
thing, like literals instead of variables, we even tried specifying
the entire thing on the command line, unfortunately with a result
no different from the others.

Again, thanks in advance.

Tom (and Andrew)


On Tue, 2005-07-12 at 17:41 +0200, Thomas Rasmussen wrote:
> Thanks for this important information. 
> It worked well now !
> 
> Tom
> 
> 
> On Tue, 2005-07-12 at 08:58 -0500, Smuts, Aaron wrote:
> > Yes.  The remote server is horribly documented.  I'll try to improve it
> > soon.  Here's a start:
> > 
> > 
> > Basically, you need a remote.cache.ccf file and a policy file.  You need
> > a policy file to run an rmi server.
> > 
> > The startup script below is in the src/scripts directory.  
> > 
> > The first argument should be the name of the config file, the second is
> > the port to start the registry on.  If you don't supply a second
> > argument, it will not start the registry; instead, it will assume that
> > you started it elsewhere.
> > 
> > It also assumes that you have a policy file, called cache.policy in
> > directory called conf.  You might need to change that.  
> > 
> > This could be your cache.policy file:
> > 
> > grant {
> >     permission java.security.AllPermission;
> > };
> > 
> > 
> > The first argument should be the name of the config file.
> > 
> > If you want to start the registry on 1101, and your remote.cache.ccf
> > file is in base of the classpath, type:
> > 
> > > startRemoteCache.sh ./remote.cache.ccf 1101
> > 
> > 
> > The remote.cache.ccf file is just a cache.ccf file with these extras:
> > 
> > # Registry used to register and provide the IRmiCacheService service.
> > registry.host=localhost
> > registry.port=1101
> > # call back port to local caches.
> > remote.cache.service.port=1101
> > # cluster setting
> > remote.cluster.LocalClusterConsistency=true
> > 
> > 
> > You will need to change the host to the name of the machine you are
> > accessing, unless you will only be accessing it locally.
> > 
> > The registry port is the port the registry is started on.  If you plan
> > to start the registry using the script, then you need to use the same
> > port you specified in the script.  Here, I specified 1101, as I did
> > above.
> > 
> > The service port is the callback port.  Just leave it the same as the
> > registry port.
> > 
> > The cluster consistency setting, just says that puts and removes should
> > be sent to any other cluster type remotes that are configured.
> > 
> > 
> > Here's the startRemoteCache.sh script:
> > ------------------------------------------------
> > 
> > #! /bin/sh
> > 
> > export CLASSPATH=.
> > export CLASSPATH=${CLASSPATH}:`dirname
> > $0`/../conf:/usr/java/jcs/conf:/usr/java/jcs/conf/
> > 
> > THISDIR=`dirname $0`
> > 
> > for i in `find ${THISDIR}/../lib -name "*.jar" `
> > do
> >         export CLASSPATH=${CLASSPATH}:$i
> > done
> > echo "Classpath = ${CLASSPATH}"
> > 
> > #START THE REGISTRY
> > if [ "$2" != "" ]; then
> >   echo "Starting the registry on port $2"
> >   rmiregistry $2 &
> > else
> >   echo "Not starting registry, since no port was supplied."
> > fi
> > 
> > POLICY="-Djava.security.policy=`dirname $0`/../conf/cache.policy"
> > 
> > HEAP="-Xms128m -Xmx512m"
> > 
> > DEBUG="-verbose:gc -XX:+PrintTenuringDistribution"
> > 
> > ARGS="$HEAP $DEBUG $POLICY"
> > 
> > echo $ARGS
> > 
> > java  $ARGS
> > org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory "$1"
> > 
> > -----------------------------------------------------------------
> > 
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Thomas Rasmussen [mailto:rasmussen@2e-systems.com]
> > > Sent: Tuesday, July 12, 2005 4:53 AM
> > > To: JCS Users List
> > > Subject: RE: Remote Auxiliary Cache
> > > 
> > > Ok, I've downloaded the sample script and customized
> > > it so that it uses the correct file structure and the
> > > correct amount of memory available to me.
> > > 
> > > I start this script from the command line like this
> > > (having changed the port also in cache.ccf and remote.cache.ccf):
> > > 
> > > 
> > > %> ./startRemoteCache.sh localhost 1100
> > > 
> > > 
> > > thus providing the hostname as argument $1 and port as $2.
> > > 
> > > Is this correct ?
> > > 
> > > 
> > > When doing so I get the following:
> > > Starting the registry on port 1100
> > > -Xms128m -Xmx256m -verbose:gc -XX:+PrintTenuringDistribution -
> > > Djava.security.policy=./../config/security.policy
> > > log4j:WARN No appenders could be found for logger
> > > (org.apache.jcs.auxiliary.remote.RemoteUtils).
> > > log4j:WARN Please initialize the log4j system properly.
> > > [Full GC 2466K->316K(130112K), 0.0306250 secs]
> > > Exception in thread "main" java.lang.NullPointerException
> > >         at
> > java.util.Properties$LineReader.readLine(Properties.java:365)
> > >         at java.util.Properties.load(Properties.java:293)
> > >         at
> > org.apache.jcs.engine.control.CompositeCacheManager.configure
> > > (CompositeCacheManager.java:168)
> > >         at
> > >
> > org.apache.jcs.auxiliary.remote.server.RemoteCacheServer.createCacheMana
> > ge
> > > r(RemoteCacheServer.java:157)
> > >         at
> > org.apache.jcs.auxiliary.remote.server.RemoteCacheServer.init
> > > (RemoteCacheServer.java:127)
> > >         at
> > >
> > org.apache.jcs.auxiliary.remote.server.RemoteCacheServer.<init>(RemoteCa
> > ch
> > > eServer.java:109)
> > >         at
> > >
> > org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory.startup
> > > (RemoteCacheServerFactory.java:115)
> > >         at
> > > org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory.main
> > > (RemoteCacheServerFactory.java:287)
> > > 
> > > 
> > > My cache.ccf and remote.cache.ccf files resides in a
> > > directory included in the classpath variable.
> > > 
> > > Where does the NullPointerException come from ?
> > > 
> > > 
> > > Being  a less experienced Developer there could be
> > > some general things about the remote variant of the JCS
> > > system, that some of you might want to straighten out
> > > to me. I've read the document on JSC from the apache site
> > > maybe 3 times but some (many) things still remain
> > > unclear to me. Any advice and/or recommendation will
> > > be appreciated.
> > > 
> > > Thanks for your time and efforts
> > > 
> > > Tom
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > On Mon, 2005-07-11 at 10:03 -0500, Smuts, Aaron wrote:
> > > > Did you start the remote cache server?  There is a sample script in
> > the
> > > > src/scripts directory.
> > > >
> > > > > -----Original Message-----
> > > > > From: Thomas Rasmussen [mailto:rasmussen@2e-systems.com]
> > > > > Sent: Monday, July 11, 2005 11:00 AM
> > > > > To: JCS Users List
> > > > > Subject: RE: Remote Auxiliary Cache
> > > > >
> > > > > My remote.cache.ccf, which is included in the classpath
> > > > > looks like this:
> > > > >
> > > > > registry.host=localhost
> > > > > registry.port=1099
> > > > >
> > > > > remote.cache.service.port=1099
> > > > > remote.cluster.LocalClusterConsistency=true
> > > > >
> > > > >
> > > > > Did I put this file in the wrong place ?
> > > > >
> > > > > Tom
> > > > >
> > > > >
> > > > > On Mon, 2005-07-11 at 08:36 -0500, Smuts, Aaron wrote:
> > > > > >
> > > > > > What does your remote cache config file look like?
> > > > > >
> > > > > > You have to startup the remote server, which uses a slightly
> > > > different
> > > > > > config file.  Did you do this?
> > > > > >
> > > > > >
> > > > > > Aaron
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Thomas Rasmussen [mailto:rasmussen@2e-systems.com]
> > > > > > > Sent: Monday, July 11, 2005 6:16 AM
> > > > > > > To: JCS Users List
> > > > > > > Subject: Remote Auxiliary Cache
> > > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I have an application that is running
> > > > > > > fine using a local cache.
> > > > > > > I've tried to configure it to use a
> > > > > > > remote auxiliary cache having add the
> > > > > > > following section to my cache.ccf:
> > > > > > >
> > > > > > >
> > > > > > > ## REMOTE RMI CACHE WITHOUT FAILOVER
> > > > > > >
> > > > > > >
> > > > > >
> > > >
> > jcs.auxiliary.RCache=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
> > > > > > >
> > > > > >
> > > >
> > jcs.auxiliary.RCache.attributes=org.apache.jcs.auxiliary.remote.RemoteCa
> > > > > > ch
> > > > > > > eAttributes
> > > > > > > jcs.auxiliary.RCache.attributes.RemoteTypeName=LOCAL
> > > > > > > jcs.auxiliary.RCache.attributes.RemoteHost=localhost
> > > > > > > jcs.auxiliary.RCache.attributes.RemotePort=1099
> > > > > > > jcs.auxiliary.RCache.attributes.GetOnly=true
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > The rest of my cache.ccf looks like this:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > #### DEFAULT CACHE REGION
> > > > > > >
> > > > > > > jcs.default=DC,RCache
> > > > > > >
> > > > > >
> > > >
> > jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttribut
> > > > > > es
> > > > > > > JCS.default.cacheattributes.MaxObjects=1200
> > > > > > >
> > > > > >
> > > >
> > jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory
> > > > > > .l
> > > > > > > ru.LRUMemoryCache
> > > > > > > jcs.default.cacheattributes.maxMemoryIdleTimeSeconds=3600
> > > > > > >
> > > >
> > jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
> > > > > > > jcs.default.elementattributes.IsEternal=false
> > > > > > > jcs.default.elementattributes.maxLifeSeconds=3600
> > > > > > > jcs.default.elementattributes.IdleTime=1800
> > > > > > > jcs.default.elementattributes.IsSpool=true
> > > > > > > jcs.default.elementattributes.IsLateral=false
> > > > > > > jcs.default.elementattributes.IsRemote=true
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > #### PREDEFINED CACHE REGIONS
> > > > > > >
> > > > > > > jcs.region.testCache1=DC,RCache
> > > > > > >
> > > > > >
> > > >
> > jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCac
> > > > > > he
> > > > > > > Attributes
> > > > > > > jcs.region.testCache1.cacheattributes.MaxObjects=1200
> > > > > > >
> > > > > >
> > > >
> > jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.jcs.eng
> > > > > > in
> > > > > > > e.memory.lru.LRUMemoryCache
> > > > > > >
> > > > jcs.region.testCache1.cacheattributes.maxMemoryIdleTimeSeconds=7200
> > > > > > >
> > > > > >
> > > >
> > jcs.region.testCache1.elementattributes=org.apache.jcs.engine.ElementAtt
> > > > > > ri
> > > > > > > butes
> > > > > > > jcs.region.testCache1.elementattributes.IdleTime=1800
> > > > > > > jcs.region.testCache1.elementattributes.IsEternal=false
> > > > > > > jcs.region.testCache1.elementattributes.IsSpool=true
> > > > > > > jcs.region.testCache1.elementattributes.IsLateral=false
> > > > > > > jcs.region.testCache1.elementattributes.IsRemote=true
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > #### AVAILABLE AUXILIARY CACHES
> > > > > > > # Primary disk cache
> > > > > > >
> > > > > > >
> > > > > >
> > > >
> > jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheF
> > > > > > ac
> > > > > > > tory
> > > > > > >
> > > > > >
> > > >
> > jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.Indexe
> > > > > > dD
> > > > > > > iskCacheAttributes
> > > > > > > jcs.auxiliary.DC.attributes.DiskPath=/tmp/jcs/raf
> > > > > > > jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000
> > > > > > > jcs.auxiliary.DC.attributes.MaxKeySize=10000
> > > > > > > jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000
> > > > > > > jcs.auxiliary.DC.attributes.MaxRecycleBinSize=7500
> > > > > > >
> > > > > > >
> > > > > > > When trying to run this after having started the rmiregistry,
> > > > > > > I get the following error messages:
> > > > > > >
> > > > > > >
> > > > > > > "ERROR  - Problem finding server at
> > > > > > >
> > > > > >
> > > >
> > [//localhost:1099/org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheS
> > > > > > er
> > > > > > > vice]"
> > > > > > >
> > > > > > >
> > > > > > > Furthermore I get the following stack trace (upper part):
> > > > > > >
> > > > > > >
> > > > > > > "java.rmi.NotBoundException:
> > > > > > > org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService
> > > > > > >         at
> > > > > > > sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer
> > > > > > > (StreamRemoteCall.java:247)
> > > > > > >         at sun.rmi.transport.StreamRemoteCall.executeCall
> > > > > > > (StreamRemoteCall.java:223)
> > > > > > >         at
> > sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
> > > > > > >         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown
> > > > Source)
> > > > > > >         at java.rmi.Naming.lookup(Naming.java:84)"
> > > > > > >
> > > > > > >
> > > > > > > I've tested the port 1099 after having issued the rmiregistry
> > > > > > > command and it is open.
> > > > > > >
> > > > > > >
> > > > > > > What have I misunderstood/screwed up ?
> > > > > > >
> > > > > > >
> > > > > > > Tom
> > > > > > >
> > > > > > >
> > > > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail:
> > jcs-users-unsubscribe@jakarta.apache.org
> > > > > > > For additional commands, e-mail:
> > jcs-users-help@jakarta.apache.org
> > > > > >
> > > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> > > > > > For additional commands, e-mail:
> > jcs-users-help@jakarta.apache.org
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org


---------------------------------------------------------------------
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