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: How to start up Remote Cache Server in JCS
Date Wed, 21 Jun 2006 19:39:01 GMT
Put the directory where the remote.cache.ccf file and
your policy file are located int he classpath.  

You could pice together the prep.bat file and the
startup and you'd be fine.  I didn't pretty much this
below:


Here is an example startRC.bat

-------------------

@rem echo on

:setcurdir
set CURDIR=%CD%
echo %CURDIR%

goto javahome

:javahome
if "%JAVA_HOME%" == "" goto noJavaHome
goto setcpbase

:noJavaHome
echo Warning: JAVA_HOME environment variable is not
set.
set JAVA_HOME=C:\jdk1.2.2

:setcpbase
set CLASSPATH=.
set CLASSPATH=%CLASSPATH%;%CURDIR%\conf\
goto jars

:jars
set _LIBJARS=
for %%i in (%CURDIR%\jars\*.jar) do call :cpappend %%i
if not "%_LIBJARS%" == "" goto addLibJars

:cpappend
echo %_LIBJARS%
set _LIBJARS=%_LIBJARS%;%1%

:addLibJars
set CLASSPATH=%CLASSPATH%;%_LIBJARS%
goto run  
  
:run
rem set DBUGPARM=-classic -Xdebug -Xnoagent
-Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,address=5000,suspend=n
%JAVA_HOME%\bin\java %DBUGPARM% -verbosegc
-XX:+PrintTenuringDistribution -ms10m -mx200m
-classpath %CLASSPATH%
"-Djava.security.policy=%CURDIR%\conf\cache.policy"
org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory
/remote.cache.ccf
  
--------------------------


Put the log4j.properties, a cache.policy, and the
remote.cache.ccf file in a conf directory.

Put the log4j, commons-logging, and jcs jars in a jars
directory.  










--- emily chen <emilychen_2002@yahoo.com> wrote:

> Hi Alistair,
>    
>   I modified prep.bat to put jcs-1.2.7.6.jar,
> commons-logging.jar, concurrent.jar, and confige
> file - remote.cache.ccf to my CLASSPATH. Then I
> double click startRemoteCache.bat, and alway got
> error message:
>  
>
-----------------------------------------------------------------------
>   [GC
>   Desired survivvor size 32768 bytes, new threshold
> 1 (max 15)
>   - age 1:     65536 bytes,     65536 total
>    640K->153K(10176), 0.0038131 secs]
>   Jun 21, 2006 11:41:57 Am
> org.apache.jcs.auxiliary.retmote.RemoteUtils
> loadProps
>   SERVERE: Error loading remote properties, for file
> name [/remote.cache.ccf]
>   java.lang.NullPointerException
>         at
>
java.util.Properties$LineReader.readline(Properties.java:365)
>         at java.util.Properties.load(Properties.java
> 293)
>         at
> org.apache.jcs.auxiliary.retmote.RemoteUtils
> loadProps(RemoteUtils.java: 93)
>   ..............
>    
>    
>   why it cannot find the property file
> remote.cache.ccf. I already put it in my classpath?
> do you have any idea? I want to put jcs remote cache
> server, tomcat, and my web application  on one box
> --- my PC (window XP).
>    
>   also I would like to download all the source code
> of JCS project, so that I can look into the source
> code if I have some question. Where can I download
> the src jar of JCS project?
>    
>   Thanks for your help.
>    
>   Lucy
> 
> Alistair Forbes <forbes.al@googlemail.com> wrote:
>   Hi,
> 
> If your JCS remote server is running you should be
> able to telnet to the
> port with something like:
> 
> telnet localhost 1102
> 
> Copy the config file into your classpath, and then
> you should be able to use
> something like:
> 
> java -cp YOURCLASSPATH
> -Djava.security.policy=../config/security.policy -
> Dlog4j.configuration=file:../config/logger/cache.xml
>
org.apache.jcs.auxiliary.remote.server.RemoteCacheServerFactory/remote.cache.ccf
> 
> Regards
> Al
> 
> 
> On 6/20/06, emily chen wrote:
> >
> > 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.(
> > 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:
> 
=== 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