• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JCS - IndexedDiskCache is not working in case of 2 different web application hosted on 2 diff. ser

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Team,

I am working on JCS for below scenerio.

1. Web application ABC hosted on server 1 will prepare a Cache Object and put it at disk at location C:/data.

2. Web application XYZ hosted on server 2 will read a Cache Object prepared at Step 1 at C:/data.

We are seeing, writing to cache and putting at disk at location C:/data is working fine. But when Web application XYZ trying to retrieve the the cache, it is getting Null object.
Could you please? We have tried so many option but could not success.

Web application ABC - Configuration - Writer Application

jcs.region.SharedCache=SharedCacheDC
jcs.region.SharedCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.SharedCache.cacheattributes.MaxObjects=0
jcs.region.SharedCache.cacheattributes.DiskUsagePatternName=UPDATE
jcs.region.SharedCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.SharedCache.cacheattributes.UseMemoryShrinker=false
jcs.region.SharedCache.cacheattributes.MaxSpoolPerRun=100
jcs.region.SharedCache.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.region.SharedCache.elementattributes.IsEternal=true
jcs.region.SharedCache.elementattributes.IsSpool=true
jcs.region.SharedCache.elementattributes.IsLateral=true
jcs.region.SharedCache.elementattributes.IsRemote=true

jcs.auxiliary.SharedCacheDC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.SharedCacheDC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.SharedCacheDC.attributes.DiskPath=c:/data

JCS abcCache = JCS.getInstance("SharedCache");
sharedDataCache.put("testingCacheKey","This is cache from ABC" + System.currentTimeMillis());

This is working fine

=============================================================================

Web application XYZ - Configuration - Reader Application

jcs.region.SharedCache=SharedCacheDC
jcs.region.SharedCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.SharedCache.cacheattributes.MaxObjects=0
jcs.region.SharedCache.cacheattributes.DiskUsagePatternName=UPDATE
jcs.region.SharedCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.SharedCache.cacheattributes.UseMemoryShrinker=false
jcs.region.SharedCache.cacheattributes.MaxSpoolPerRun=100
jcs.region.SharedCache.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.region.SharedCache.elementattributes.IsEternal=true
jcs.region.SharedCache.elementattributes.IsSpool=true
jcs.region.SharedCache.elementattributes.IsLateral=true
jcs.region.SharedCache.elementattributes.IsRemote=true


jcs.auxiliary.SharedCacheDC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.SharedCacheDC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.SharedCacheDC.attributes.DiskPath=c:/data


JCS SharedCache = JCS.getInstance("SharedCache");
String s = sharedDataCache.get("testingCacheKey");

The above get statement is returning null. Could you pleade help here?
 
umesh jadhav
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
-
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic