Return-Path: X-Original-To: apmail-jakarta-jcs-users-archive@www.apache.org Delivered-To: apmail-jakarta-jcs-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3D3B89520 for ; Wed, 28 Dec 2011 13:49:42 +0000 (UTC) Received: (qmail 93981 invoked by uid 500); 28 Dec 2011 13:49:42 -0000 Delivered-To: apmail-jakarta-jcs-users-archive@jakarta.apache.org Received: (qmail 93915 invoked by uid 500); 28 Dec 2011 13:49:42 -0000 Mailing-List: contact jcs-users-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JCS Users List" Delivered-To: mailing list jcs-users@jakarta.apache.org Received: (qmail 93907 invoked by uid 99); 28 Dec 2011 13:49:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Dec 2011 13:49:42 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [220.225.41.111] (HELO punoutbound.symphonysv.com) (220.225.41.111) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Dec 2011 13:49:35 +0000 X-IronPort-AV: E=Sophos;i="4.71,421,1320604200"; d="scan'208";a="27984925" Received: from unknown (HELO PUN2K3EXMB05.symphonysv.com) ([10.55.2.75]) by punoutbound.symphonysv.com with ESMTP; 28 Dec 2011 18:51:03 +0530 Received: from PUN2K7EXCL01.symphonysv.com ([10.55.2.146]) by PUN2K3EXMB05.symphonysv.com ([10.55.2.75]) with mapi; Wed, 28 Dec 2011 19:19:06 +0530 From: Narendra Verma To: JCS Users List , Commons Users List Date: Wed, 28 Dec 2011 19:19:02 +0530 Subject: RE: Need Help on JCS Remote Cache Thread-Topic: Need Help on JCS Remote Cache Thread-Index: AczFZ1Lelz3p12ukT+KlAEosN2z6bAAABOsg Message-ID: References: <4EFB1DE5.2010600@apache.org> In-Reply-To: <4EFB1DE5.2010600@apache.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Thanks Thomas.=20 Thanks & Regards, Narendra Verma -----Original Message----- From: Thomas Vandahl [mailto:tv@apache.org]=20 Sent: Wednesday, December 28, 2011 7:17 PM To: Commons Users List Cc: JCS Users List Subject: Re: Need Help on JCS Remote Cache On 26.12.11 09:11, Narendra Verma wrote: > Hi All, >=20 > I have made setup of JCS in my Linux environment and trying to make a POC= using Remote Cache. I cannot help you much with this problem. Just a hint that the users list for JCS changed to user@commons.apache.org. I redirected your message to there. Bye, Thomas. >=20 > My System Setup: >=20 >=20 > * RMI Server : Running on 10.55.164.215 (using RMI Start up Servl= et) >=20 > * Client-1: Running on box 10.55.164.215 on same machine where se= rer is running >=20 > * Client-2: Running on box 10.55.164.45 >=20 >=20 > My Configuration Files: >=20 > * Server Configuration >=20 >=20 > # ---------------------------------------------- > # Registry used to register and provide the > # IRemoteCacheService service. > registry.host=3D10.55.164.215 > registry.port=3D1102 > # call back port to local caches. > remote.cache.service.port=3D1102 > # rmi socket factory timeout > remote.cache.rmiSocketFactoryTimeoutMillis=3D5000 > # cluster setting > remote.cluster.LocalClusterConsistency=3Dfalse > remote.cluster.AllowClusterGet=3Dfalse > # ---------------------------------------------- >=20 > # DEFAULT CACHE REGION > jcs.default=3D > jcs.default.cacheattributes=3Dorg.apache.jcs.engine.CompositeCacheAttribu= tes > jcs.default.cacheattributes.MaxObjects=3D1000 > jcs.default.cacheattributes.MemoryCacheName=3Dorg.apache.jcs.engine.memor= y.lru.LRUMemoryCache >=20 > # PRE-DEFINED CACHE REGIONS > jcs.region.userCache=3D > jcs.region.userCache.cacheattributes=3Dorg.apache.jcs.engine.CompositeCac= heAttributes > jcs.region.userCache.cacheattributes.MaxObjects=3D1000 > jcs.region.userCache.cacheattributes.MemoryCacheName=3Dorg.apache.jcs.eng= ine.memory.lru.LRUMemoryCache > jcs.region.userCache.cacheattributes.UseMemoryShrinker=3Dfalse > jcs.region.userCache.cacheattributes.MaxMemoryIdleTimeSeconds=3D3600 > jcs.region.userCache.cacheattributes.ShrinkerIntervalSeconds=3D60 > jcs.region.userCache.cacheattributes.MaxSpoolPerRun=3D500 > jcs.region.userCache.elementattributes=3Dorg.apache.jcs.engine.ElementAtt= ributes > jcs.region.userCache.elementattributes.IsEternal=3Dfalse >=20 >=20 >=20 >=20 >=20 >=20 > * Client-1 and Client-2 Configuration at separate boxes - See th= e above in System Setup Section > # DEFAULT CACHE REGION > # sets the default aux value for any non configured caches > jcs.default=3DRC > jcs.default.cacheattributes=3Dorg.apache.jcs.engine.CompositeCacheAttribu= tes > jcs.default.cacheattributes.MaxObjects=3D1000 > jcs.default.cacheattributes.MemoryCacheName=3Dorg.apache.jcs.engine.memor= y.lru.LRUMemoryCache > jcs.default.elementattributes.IsEternal=3Dfalse > jcs.default.elementattributes.MaxLifeSeconds=3D3600 > jcs.default.elementattributes.IdleTime=3D1800 > jcs.default.elementattributes.IsSpool=3Dtrue > jcs.default.elementattributes.IsRemote=3Dtrue > jcs.default.elementattributes.IsLateral=3Dfalse >=20 > # CACHE REGIONS AVAILABLE >=20 > # Regions preconfigured for caching > jcs.region.userCache=3DRC > jcs.region.userCache.cacheattributes=3Dorg.apache.jcs.engine.CompositeCac= heAttributes > jcs.region.userCache.cacheattributes.MaxObjects=3D1200 > jcs.region.userCache.cacheattributes.MemoryCacheName=3Dorg.apache.jcs.eng= ine.memory.lru.LRUMemoryCache > jcs.region.userCache.elementattributes.IsEternal=3Dfalse > jcs.region.userCache.elementattributes.MaxLifeSeconds=3D7200 > jcs.region.userCache.elementattributes.IdleTime=3D1800 > jcs.region.userCache.elementattributes.IsSpool=3Dtrue > jcs.region.userCache.elementattributes.IsRemote=3Dtrue > jcs.region.userCache.elementattributes.IsLateral=3Dfalse >=20 > # Remote RMI Cache set up to failover > # This remote client does not receive > jcs.auxiliary.RC=3Dorg.apache.jcs.auxiliary.remote.RemoteCacheFactory > jcs.auxiliary.RC.attributes=3Dorg.apache.jcs.auxiliary.remote.RemoteCache= Attributes > jcs.auxiliary.RC.attributes.FailoverServers=3D10.55.164.215:1102 > jcs.auxiliary.RC.attributes.LocalPort=3D1202 > jcs.auxiliary.RC.attributes.RemoveUponRemotePut=3Dtrue > jcs.auxiliary.RC.attributes.RmiSocketFactoryTimeoutMillis=3D5000 > jcs.auxiliary.RC.attributes.GetOnly=3Dfalse > jcs.auxiliary.RC.attributes.Receive=3Dtrue >=20 >=20 >=20 >=20 >=20 >=20 >=20 > Client Test Programs: >=20 > Input parameters while running client-1 : java com.brightsky.util.JCSTes= t /cache-client1.ccf > Input parameters while running client-2 : java com.brightsky.util.JCSTes= t /cache.ccf-client1 >=20 >=20 > package com.brightsky.util; > import java.util.Date; >=20 > /* > * This code is property of BrightSky, Inc. Use, duplication and disclosu= re > * in any form without permission of copyright holder is prohibited. > * > * (C) Copyright BrightSky, Inc. 2011. All rights reserved. > */ >=20 > /** > * @author nverma > * > */ > public class JCSTest { > public static void main(String a[]) throws InterruptedException { >=20 > System.out.println("\n =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n" ); > System.out.println("\n =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D QA Node - "= +a[0]+ "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n" ); > System.out.println("\n =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n" ); >=20 > System.out.println("\n ----------------------------------Initiali= zing JCS....\n" ); >=20 >=20 > CacheManager cm =3D CacheManager.getInstance(a[0]); >=20 > System.out.println("\n ----------------------------------Initiali= zed Successfully.\n" ); >=20 > int userId =3D 1; > int notificationCount =3D 10 ; > int loopCount =3D 5 ; > int threadSleepSec =3D 2 ; >=20 >=20 > userId =3D 1; > notificationCount =3D10; > loopCount =3D5; > threadSleepSec =3D2; >=20 > UserCacheObj userObject; > // If no, then write and fetch in loop > // if yes, no write only fetch object of passed userid > if("no".equals(a[6])){ >=20 > // Create Object > userObject =3D new UserCacheObj(); > userObject.setUserId(userId); > userObject.setNotificationCount(notificationCount); >=20 > System.out.println("\n ----------------------------------Stor= ing object into cache....\n" ); > // Store the object into cache > cm.storeUserbj(userObject); >=20 > System.out.println("\n ----------------------------------Stor= ed Successfully.\n" ); >=20 > } >=20 >=20 > System.out.println("\n ---------------Starting loop to fetch and = increment notification count for userId ["+userId+"] .....\n" ); >=20 > for(int i=3D1; i<=3DloopCount; i++){ >=20 > System.out.println("\n -----------[Attemp : "+i+"] \n" ); >=20 > Date date =3D new Date(); >=20 > userObject =3D cm.getUserObj(userId); >=20 > System.out.println("\n ----------- ["+date+"] Fetched Notific= ation Count =3D "+userObject.getNotificationCount()); >=20 > int notificationCnt =3D userObject.getNotificationCount() + 1= ; >=20 > userObject.setNotificationCount(notificationCnt); >=20 > date =3D new Date(); >=20 > System.out.println("\n ----------- Incremented notification c= ount ["+notificationCnt+"] "); >=20 > cm.storeUserbj(userObject); >=20 > System.out.println("\n ----------- ... ["+date+"] Pushed to u= pdated object "); >=20 >=20 > Thread.sleep(1000 * threadSleepSec); >=20 > } >=20 > System.out.println("\n ----------- Loop End. !!!! Good Bye !!!!= \n" ); >=20 > } > } >=20 >=20 >=20 > Question and Problem: >=20 > When I put any object from either client-1 or client-2 then server shows = log that it is creating listener for corresponding clients. And event is pu= t successfully. >=20 > Server logs on Client-1 Run >=20 > 2011-12-25 15:46:12,801 INFO [org.apache.jcs.auxiliary.remote.server.Rem= oteCacheServer] (RMI TCP Connection(78)-10.55.164.145) adding vm listener u= nder new id =3D [46], listenerAddress [127.0.0.1] > 2011-12-25 15:46:12,801 INFO [org.apache.jcs.auxiliary.remote.server.Rem= oteCacheServer] (RMI TCP Connection(78)-10.55.164.145) Region userCache's l= istener size =3D 2 >=20 > Server logs on Client-2 Run >=20 > 2011-12-25 16:04:11,509 INFO [org.apache.jcs.auxiliary.remote.server.Rem= oteCacheServer] (RMI TCP Connection(91)-10.55.164.215) adding vm listener u= nder new id =3D [48], listenerAddress [10.55.164.215] > 2011-12-25 16:04:11,509 INFO [org.apache.jcs.auxiliary.remote.server.Rem= oteCacheServer] (RMI TCP Connection(91)-10.55.164.215) Region userCache's l= istener size =3D 3 >=20 >=20 > Scenario-1: > When I put object from client-2 and access it in client-1, it is fetched = successfully. But when I update it in client-1 and pushed it again then cli= en-2 does not access the object with same ID and null pointer exception com= es. Event when I try to access it again with client-1 again null pointer ex= ception comes. Need to confirm why object is not accessible after updating = by any of the client? >=20 > Scenario-2: > When I put object from client-1 and access it in client-2, it never fetch= ed. Need to confirm why client-2 never access the object put by the client-= 1? Where client-1 access once if client-2 puts. >=20 >=20 > Please help/guide me to resolve these issues. >=20 > Thanks & Regards, > Narendra Verma >=20 >=20 > ________________________________ > NOTICE TO RECIPIENT: THIS E-MAIL (INCLUDING ANY ATTACHMENTS) IS MEANT FOR= ONLY THE INTENDED RECIPIENT OF THE TRANSMISSION, MAY CONTAIN CONFIDENTIAL = INFORMATION, AND IS PROTECTED BY LAW. IF YOU RECEIVED THIS E-MAIL IN ERROR,= PLEASE IMMEDIATELY NOTIFY THE SENDER OF THE ERROR BY RETURN E-MAIL, DELETE= THIS COMMUNICATION AND SHRED ANY ATTACHMENTS. UNAUTHORIZED REVIEW, USE, DI= SSEMINATION, DISTRIBUTION, COPYING OR TAKING OF ANY ACTION BASED ON THIS CO= MMUNICATION IS STRICTLY PROHIBITED. >=20 --------------------------------------------------------------------- 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