jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "paulo caroli" <pcar...@corp.blah.com>
Subject hello bookCache
Date Thu, 30 Oct 2003 18:29:32 GMT
Hi all,

 

I am new to jcs and I am trying to run the BookCache sample available in the
web site (http://jakarta.apache.org/turbine/jcs/UsingJCSBasicWeb.html)

I changed the cache.ccf to make it work as a local cache (please find
cache.ccf below).

 

I added the toString method to BookVObjManager class

 

public class BookVObjManager

{ .

  public String toString()

   {

     return bookCache.toString();

   }

.

 

I created a TestBookCache for istantiating the BookVObjManager and try using
the cache.

 

public class TestBookCache {

 

  public static void main(String[] args) {

    System.out.println("TestBookCache.");

    System.out.println();

    try

    {

      BookVObjManager cache = BookVObjManager.getInstance();

      System.out.println("BookVObjManager.getInstance()");

 

      System.out.println("cache.toString()");

      System.out.println(cache.toString());

 

      BookVObj book1 = cache.getBookVObj(1);

 

      System.out.println("cache.toString()");

      System.out.println(cache.toString());

    }

    catch (Exception exc)

    {

        exc.printStackTrace();

    }

 

  }

 

}

 

 

When executing I get the following error:

TestBookCache.

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

        at org.apache.jcs.access.CacheAccess.<clinit>(CacheAccess.java:90)

        at BookVObjManager.<init>(BookVObjManager.java:17)

        at BookVObjManager.getInstance(BookVObjManager.java:36)

        at TestBookCache.main(TestBookCache.java:11)

Exception in thread "main"

 

 

Any hints?

 

Thanks in advance,

Paulo

 

 

Cache.ccf

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

# DEFAULT CACHE REGION

jcs.default=DC

jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes

jcs.default.cacheattributes.MaxObjects=2000

jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru
.LRUMemoryCache

jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes

jcs.default.elementattributes.IsEternal=false

jcs.default.elementattributes.MaxLifeSeconds=2400

jcs.default.elementattributes.IdleTime=1800

jcs.default.elementattributes.IsSpool=false

jcs.default.elementattributes.IsRemote=false

jcs.default.elementattributes.IsLateral=false

 

 

#Region

jcs.region.bookCache =DC

jcs.region.bookCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAtt
ributes

jcs.region.bookCache.cacheattributes.MaxObjects=4000

jcs.region.bookCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.m
emory.lru.LRUMemoryCache

jcs.region.bookCache.cacheattributes.UseMemoryShrinker=true

jcs.region.bookCache.cacheattributes.MaxMemoryIdleTimeSeconds=3600

jcs.region.bookCache.cacheattributes.ShrinkerIntervalSeconds=600

jcs.region.bookCache.elementattributes=org.apache.jcs.engine.ElementAttribut
es

jcs.region.bookCache.elementattributes.IsEternal=false

jcs.region.bookCache.elementattributes.MaxLifeSeconds=2400

jcs.region.bookCache.elementattributes.IdleTime=180

jcs.region.bookCache.elementattributes.IsSpool=false

jcs.region.bookCache.elementattributes.IsRemote=false

jcs.region.bookCache.elementattributes.IsLateral=false

end of Cache.ccf

 

 

 

 


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