Re: [Aglets-developer] Remote messaging between aglets not working . Getting remote proxy address
Status: Beta
Brought to you by:
cat4hire
From: Anil K. <akr...@ya...> - 2005-10-20 07:40:49
|
Hi Luca and All, Hope you are trying to solve this remote messaging problem .I think you working on this problem as i did not see any reply or hint for this message for the past 1 week . I was also trying to solve this problem at my end . Thought of giving the update i got as it may give you clue to get the problem solved. I was just trying to test remote messaging with some of the code that was given in the "agletbook" code. I used the files "Parallel1Example.java" and "Worker1.java" . Here Parallel1Example is creating the agent "Worker1" and dispatching that to a remote machine.While "Worker1 " is being created proxy of the Parallel1Example is passed as the third argument for the createAglet() method. Once the "Worker1" reaches the remote system , it is able to send the message to the parent i.e to Parallel1Example . On my ststems i tried this code and these two are able to communicate properly.I mean worker1 ias able to send a remote message to Parallel1Example without any errors. May be you can see the code of "Parallel1Example.java" and "Worker1.java" which can give you a clue for what might be the problem. I attached the source files i used for testing , to this message for your easy reference. Please let me know if you find some thing that will solve the problem. Thanks Anil --- Anil Kumar <akr...@ya...> wrote: > Hi Luca and ALL , > > After setting the classpaths properly i run the > following command at command prompt > " java com.ibm.maf.rmi.MAFFInder_RMIImpl " and i > got > the follwoing message . > > ------------------------------------------- > akvz2@r24intelsys lib]$ pwd > /home/akvz2/java/aglets/lib > [akvz2@r24intelsys lib]$ java > com.ibm.maf.rmi.MAFFinder_RMIImpl > MAFFinder bound in local registry > name: MAFFinder > port: 4435 > ------------------------------------------- > > Now i tried for remote messaging between agletA and > > agletB .( A the bottom i pasted the code i used for > > agletA and agletB for remote messaging.) > > I got the following message at the thahithi console > prompt ... > > ---------------------------------------------- > $$$$$$$$$$ The new agent has ID > =b526aec0c16aa03c > ***** Addr: atp://131.151.8.211 place: > No integrity check because no security domain is > authenticated. > remoteProxy is :AgletProxyImpl : RemoteAgletRef : > null .. WeakRef[count=1] > > ---------------------------------------------- > > Strangely .. this time no exception is being thrown > like earlier.Earlier i used to get > com.ibm.aglet.NotHandledException . I guess the > exception is not coming because of your new > "com.ibm.aglets.FutureReplyImpl.java" file. > > But i have a doubt .. Is message is being sent or > not > at all ..? > > I tested this remote messaging code when MAFFinder > is > running on a different terminal on the same system > where aglets thahithi is running AND when > MAFFinder > is not running .Both times i got the same out put as > i > shoed above. > > Please let me know what else i can do to make the > remote messaging working .It is very crucial for my > project to have remote and local messaging working. > If > i am not able to achieve this .. the purpose of > using > aglets for my project is defeated :-) . I will be in > lot of touble : :-/ :( . > > Following is the agletA and agletB code i used > for > remote Messaging. > > -------------------------Remote Mesaing : > agletA------ > > package old; > import com.ibm.aglet.*; > import java.net.*; > > public class agletA extends Aglet { > > public void run() > { > try > { > //Get the aglet context > AgletContext context = > this.getAgletContext(); > > //Create the agletB instance. > AgletProxy toMove = > context.createAglet(null, "old.agletB", null); > > //Save the new aglet ID > AgletID remoteID = toMove.getAgletID(); > System.out.println(" $$$$$$$$$$ The > new agent has ID ="+remoteID); > > //Migrate the new agent > String remoteContext = > "atp://131.151.8.211:4434"; > URL url = new URL(remoteContext); > toMove.dispatch(url); > > //Get the remote Proxy > AgletProxy remoteProxy = > context.getAgletProxy(url,remoteID); > > try > { > System.out.println(" remoteProxy is > :"+remoteProxy); > //Send message to the remote agent > remoteProxy.sendMessage(new > Message("HELL")); > } > catch(Exception e) > { > System.out.println("Message is not > sent .Exception is :"+e); > e.printStackTrace(); > } > } > catch(Exception e ) > { > System.out.println("Exception is :"+e); > } > } > } > > > ----------RemoteMessaging agletB-------------------- > > package old; > import com.ibm.aglet.*; > import java.net.*; > > public class agletB extends Aglet { > > public void run() > { > try > { > AgletID myID = this.getAgletID(); > System.out.println(" In aglet B .myID is > :"+myID); > } > catch (Exception e) > { > System.out.println("Exception is :"+e); > } > } > > //handle the message. > public boolean handleMessgae(Message msg) > { > System.out.println(" Just entered in the > handleMessgae () of agletB ."); > if( msg.sameKind("HELL")) > { > System.out.println("I am aglet . HELLO > message received from agletA. "); > return true; > } > return false; > } > } > > > Appreciate your help ... > > Thanks > Anil > > > --- Luca Ferrari <cat...@us...> > wrote: > > Anil Kumar's cat, on 11/10/2005 21.11, walking on > the keyboard wrote: > > >$$$$$$$$$$ The new agent has ID > > =dbd9468f8f969b9e > > > myID is :dbd9468f8f969b9e > > > ***** Addr: atp://131.151.8.211 place: > > > No integrity check because no security domain is > > > authenticated. > > > remoteProxy is :AgletProxyImpl : RemoteAgletRef > : > > > null .. WeakRef[count=1] > > > Message is not sent .Exception is > > > :com.ibm.aglet.NotHandledException: > > > com.ibm.maf.NotHandled:null > > > com.ibm.aglet.NotHandledException: > > > com.ibm.maf.NotHandled:null > > > at > > > com.ibm.aglets.MessageBroker.sendMessage(Unknown > > > Source) > > > Here the exception should be raised due to a > problem > with the MAF > system. Have you tried running the MAFFINDER has I > === message truncated === __________________________________ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs |