Thread: Re: [Aglets-developer] Local messaging between two aglets in the sama context is not working ...A
Status: Beta
Brought to you by:
cat4hire
From: Anil K. <akr...@ya...> - 2005-10-16 04:52:08
|
Hi Luca and ALL , As you suggesed i have taken the file com.ibm.aglets.FutureReplyImpl.java from sourceforge,net site and compiled it along withe the other source files i downloaded earlier( from aglets-2.0.2-src.jar) .I overrite this new FutureReplyImpl.java file with the existing one and compiled. I got a compilation error at one import line that syas "import com.ibm.aglet.message.MessageException; " . There is no com.ibm.aglet.message directory at all . So i just removed this "message" directory and used " com.ibm.aglet.MessageException; " and compilation was successful . (Note : you may need to correct this error and upload it again to CVS.) Then i created a new "aglets-2.0.2.jar" with the directories "com.xx.xx and org.xx.xx.xx " I used this new jar file "aglets-2.0.2.jar" while running the application to check for local Mesaging . Now i am not getting any exception like earlier ( Earlier i got com.ibm.aglet.NotHandledException ) , but on the agletB side (where message is being handled ) looks like .. handleMessage( ) is not being called at all. I am noy sure why it is behavving like that . I kept two SOP statements ( please look into the agletB code pasted in the bottom ) in the " public boolean handleMessgae(Message msg){ } " to check whether control is coming to that function or not at all ? Those two statements are not being printed at all. I guess handleMessage() will always be looking for in coming messages once the aglet is initiated. Do we have to explicitly call the handleMessage ()....? I even send around 4 messages thinking that it will give me some clue. But no clue at all. Please help me to know what is happening here. Is the new "com.ibm.aglets.FutureReplyImpl.java" you uploaded causing some other problem solving the cancel method problem...? Following is the out put on Thahithi console ... ------------------------OUTPUT-------------------------- $$$$$$$$$ The new agent ( aglet B) has ID =a330bf4ef9619d66 localProxy is :AgletProxyImpl : Aglet [active] ClassName [baglets.agletB] Identifier[a330bf4ef9619d66] Owner[CN=anilkumar, OU=erl, O=umr, L=rolla, ST=mo, C=us] CodeBase[atp://r24intelsys:4434/] CN=anilkumar, OU=erl, O=umr, L=rolla, ST=mo, C=us Sending a new message again I am aglet B : myID is :a330bf4ef9619d66 Sending a new message again Sending a new message again Sending a new message again Sending a new message again ------------------------OUTPUT------------------------- For your reference i am copying the agletB and agletA code here ... ------------------agletA-----------------------STARTS package baglets; 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 localProxy = context.createAglet(null, "baglets.agletB", null); //Save the new aglet ID AgletID loacalID = localProxy.getAgletID(); System.out.println(" $$$$$$$$$$ The new agent ( aglet B) has ID ="+loacalID); try { System.out.println(" localProxy is :"+localProxy); //Send message to the remote agent for(int i=0 ;i<5;i++) { System.out.println(" Sending a new message again"); localProxy.sendMessage(new Message("HELL")); pause(); } } catch(Exception e) { System.out.println("Message is not sent .Exception is :"+e); e.printStackTrace(); } } catch(Exception e ) { System.out.println("Exception is :"+e); } } private static long SLEEP = 2000; private void pause() { try { Thread.sleep(SLEEP); } catch (InterruptedException ie) { } } } -----------------agletA-----------------------ENDS -----------------agletB-----------------------STARTS package baglets; import com.ibm.aglet.*; import java.net.*; public class agletB extends Aglet { public void run() { try { AgletID myID = this.getAgletID(); System.out.println(" I am 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("I am aglet B . I am at the start of the handleMessgae() "); if( msg.sameKind("HELL")) { System.out.println("I am aglet B .HELLO message received from agletA."); return true; } return false; } } -----------------agletB-----------------------ENDS Please let me know what can i do to find the problem. This simple problem is eating lot of my time. 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: > > Stack trace with local proxy .... Local messaging > . > > ------STARTS > > > > $$$$$$$$$$ The new agent has ID > =e308f78be33d8ad4 > > localProxy is :AgletProxyImpl : Aglet [active] > > ClassName [baglets.agletB] > > Identifier[e308f78be33d8ad4] > > Owner[CN=anilkumar, OU=erl, O=umr, L=rolla, > > ST=mo, C=us] > > CodeBase[atp://r24intelsys:4434/] > > CN=anilkumar, OU=erl, O=umr, L=rolla, ST=mo, C=us > > myID is :e308f78be33d8ad4 > > Message is not sent .Exception is > > :com.ibm.aglet.NotHandledException: [Message : > kind = > > HELLO: arg = {}: priority = 5] > > com.ibm.aglet.NotHandledException: [Message : kind > = > > HELLO: arg = {}: priority = 5] > > at > > com.ibm.aglets.FutureReplyImpl.cancel(Unknown > Source) > I've uploaded a versione of FutureReplyImpl a few days ago that should avoid this problem, since the cancel method is quite rude and raises often the exception. I'm still investigating on the "why" of such implementation. Luca +-------------------------------+ Luca Ferrari cat...@us... The Aglets Project: http://aglets.sourceforge.net +-------------------------------+ __________________________________ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/ |
From: Anil K. <akr...@ya...> - 2005-10-16 06:28:10
|
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 wrote you in my previous e-mail? Luca +-------------------------------+ Luca Ferrari cat...@us... The Aglets Project: http://aglets.sourceforge.net +-------------------------------+ __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |
From: Anil K. <akr...@ya...> - 2005-10-20 07:40:49
Attachments:
Parallel1Example.java
Worker1.java
|
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 |
From: Luca F. <cat...@us...> - 2005-10-26 17:03:24
Attachments:
SlaveAgent.java
CreatorAgent.java
|
Anil Kumar's cat, on 16/10/2005 6.51, walking on the keyboard wrote: > I got a compilation error at one import line that > syas "import com.ibm.aglet.message.MessageException; " > . > There is no com.ibm.aglet.message directory at all . > So i just removed this "message" directory and used > " com.ibm.aglet.MessageException; " and compilation > was successful . > > (Note : you may need to correct this error and upload > it again to CVS.) You're right, I had messed up the CVS, please be patiente, I'll fix the compilation problems in the CVS repository. Coming back to your problem, I've tried the attached agents within my system and they are working. Since they are similar to yours, I think the problem is on your systems, but I'm not sure what the problem could be (note: I used the 2.0.2 version downloaded from the web site). For the remote messaging, I think there could be a problem with a firewall, but I don't understand what the local messaging problem can be. Could you try my agents on your machine please? Moreover, try to connect with a telnet client to the remote machine on the 4434 port (or whatever port you are running the remote aglet daemon). Finally, what happens if you involve remote messaging within the same host, that means running two platforms on the same host? Thanks, Luca > > Then i created a new "aglets-2.0.2.jar" with the > directories "com.xx.xx and org.xx.xx.xx " > > I used this new jar file "aglets-2.0.2.jar" while > running the application to check for local Mesaging > . > > Now i am not getting any exception like earlier ( > Earlier i got com.ibm.aglet.NotHandledException ) , > but on the agletB side (where message is being > handled ) looks like .. handleMessage( ) is not being > called at all. > > I am noy sure why it is behavving like that . > > I kept two SOP statements ( please look into the > agletB code pasted in the bottom ) in the > " public boolean handleMessgae(Message msg){ } " > to check whether control is coming to that function > or not at all ? Those two statements are not being > printed at all. > > I guess handleMessage() will always be looking for in > coming messages once the aglet is initiated. > > Do we have to explicitly call the handleMessage > ()....? > > I even send around 4 messages thinking that it will > give me some clue. But no clue at all. > > Please help me to know what is happening here. > Is the new "com.ibm.aglets.FutureReplyImpl.java" you > uploaded causing some other problem solving the > cancel method problem...? > > > Following is the out put on Thahithi console ... > ------------------------OUTPUT-------------------------- > $$$$$$$$$ The new agent ( aglet B) has ID > =a330bf4ef9619d66 > localProxy is :AgletProxyImpl : Aglet [active] > ClassName [baglets.agletB] > Identifier[a330bf4ef9619d66] > Owner[CN=anilkumar, OU=erl, O=umr, L=rolla, > ST=mo, C=us] > CodeBase[atp://r24intelsys:4434/] > CN=anilkumar, OU=erl, O=umr, L=rolla, ST=mo, C=us > Sending a new message again > I am aglet B : myID is :a330bf4ef9619d66 > Sending a new message again > Sending a new message again > Sending a new message again > Sending a new message again > ------------------------OUTPUT------------------------- > > For your reference i am copying the agletB and > agletA > code here ... > > ------------------agletA-----------------------STARTS > package baglets; > 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 localProxy = > context.createAglet(null, "baglets.agletB", null); > > //Save the new aglet ID > AgletID loacalID = > localProxy.getAgletID(); > System.out.println(" $$$$$$$$$$ The > new agent ( aglet B) has ID ="+loacalID); > > try > { > System.out.println(" localProxy is > :"+localProxy); > //Send message to the remote agent > for(int i=0 ;i<5;i++) > { > System.out.println(" Sending a > new message again"); > localProxy.sendMessage(new > Message("HELL")); > pause(); > } > } > catch(Exception e) > { > System.out.println("Message is not > sent .Exception is :"+e); > e.printStackTrace(); > } > } > catch(Exception e ) > { > System.out.println("Exception is :"+e); > } > } > > private static long SLEEP = 2000; > > private void pause() { > try { > Thread.sleep(SLEEP); > } catch (InterruptedException ie) { } > > } > } > -----------------agletA-----------------------ENDS > > > -----------------agletB-----------------------STARTS > > package baglets; > import com.ibm.aglet.*; > import java.net.*; > > public class agletB extends Aglet { > > public void run() > { > try > { > AgletID myID = this.getAgletID(); > System.out.println(" I am 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("I am aglet B . I am at the > start of the handleMessgae() "); > > if( msg.sameKind("HELL")) > { > System.out.println("I am aglet B .HELLO > message received from agletA."); > return true; > } > return false; > } > } > > -----------------agletB-----------------------ENDS > > > Please let me know what can i do to find the > problem. This simple problem is eating lot of my time. > > 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: >> >>>Stack trace with local proxy .... Local messaging >> >>. >> >>>------STARTS >>> >>> $$$$$$$$$$ The new agent has ID >> >>=e308f78be33d8ad4 >> >>> localProxy is :AgletProxyImpl : Aglet [active] >>> ClassName [baglets.agletB] >>> Identifier[e308f78be33d8ad4] >>> Owner[CN=anilkumar, OU=erl, O=umr, L=rolla, >>>ST=mo, C=us] >>> CodeBase[atp://r24intelsys:4434/] >>>CN=anilkumar, OU=erl, O=umr, L=rolla, ST=mo, C=us >>> myID is :e308f78be33d8ad4 >>>Message is not sent .Exception is >>>:com.ibm.aglet.NotHandledException: [Message : >> >>kind = >> >>>HELLO: arg = {}: priority = 5] >>>com.ibm.aglet.NotHandledException: [Message : kind >> >>= >> >>>HELLO: arg = {}: priority = 5] >>> at >>>com.ibm.aglets.FutureReplyImpl.cancel(Unknown >> >>Source) >> > > I've uploaded a versione of FutureReplyImpl a few > days ago that should > avoid this problem, since the cancel method is quite > rude and raises > often the exception. I'm still investigating on the > "why" of such > implementation. > > Luca > +-------------------------------+ > Luca Ferrari > cat...@us... > > The Aglets Project: > http://aglets.sourceforge.net > +-------------------------------+ > > > > > > __________________________________ > Yahoo! Music Unlimited > Access over 1 million songs. Try it free. > http://music.yahoo.com/unlimited/ > > -- +-------------------------------+ Luca Ferrari cat...@us... The Aglets Project: http://aglets.sourceforge.net +-------------------------------+ |
From: Anil K. <akr...@ya...> - 2005-11-14 04:01:57
|
Hi Luca and ALL , The reason why messaging was not working was , i had a typo which cannot be easily find in the handleMessage() function . I wrote the name of the function wrongly as "handleMessgae()" .Thats why messaging was not working. Now local messaging and remote messaging is working. But i have a new problem with remote messaging. When i send a message from a CreatorAgent to the SlaveAgent ( which was created in the CreatorAgent context and dispached to another host) , SlaveAgent is able to receive the message. But how can i send a reply message from the SlaveAgent to the parent now ..? I guess the sendReply() function does not work for this type of reply messages. So I tried passing the "parentproxy" as follows while SlaveAgent being created. AgletProxy parentProxy = this.getAgletContext().getAgletProxy(getAgletID()); AgletProxy localProxy = context.createAglet(null, "fluca.SlaveAgent", parentProxy); On the SlaveAgent side tw o function s "oncreation()" and "handleMessgae()" are coded as follows, to send a reply message to the CreatorAgent.But it is not working. public boolean handleMessage(Message msg) { if( msg.sameKind("HELLO")) { try { //Send message to parent parentProxy.sendMessage(new Message("RECEIVED")); System.out.println(" Sent Hello received Message to Parent. i.e to RMCreatorAgent "); }catch(Exception e) { System.out.println(" RECEIVED reply Message is not sent .Exception is :"+e); e.printStackTrace(); } } return true; } public void onCreation(Object init) { addMobilityListener(this); System.out.println(" Called oncreation()."); parentProxy = (AgletProxy)init; System.out.println(" parentProxy is :"+parentProxy); } On the CreatorAgent side i added the following handleMessage(Message msg) function to receive the messages sent fro mSlave Agent. public boolean handleMessage(Message msg) { System.out.println(" Just entered in the handleMessgae () of CreatorAgent ."); if( msg.sameKind("RECEIVED")) { System.out.println("I am CreatorAgent.Reply Message received from SlaveAgent is :."); System.out.println(""+msg); } return true; } Please let me know how to send a reply message from SlaveAgent to the Creator Agent so that the communication is complete. -- Luca Ferrari <cat...@us...> wrote: > Anil Kumar's cat, on 16/10/2005 6.51, walking on the > keyboard wrote: > > I got a compilation error at one import line > that > > syas "import > com.ibm.aglet.message.MessageException; " > > . > > There is no com.ibm.aglet.message directory at > all . > > So i just removed this "message" directory and > used > > " com.ibm.aglet.MessageException; " and > compilation > > was successful . > > > > (Note : you may need to correct this error and > upload > > it again to CVS.) > > > You're right, I had messed up the CVS, please be > patiente, I'll fix the > compilation problems in the CVS repository. > Coming back to your problem, I've tried the attached > agents within my > system and they are working. Since they are similar > to yours, I think > the problem is on your systems, but I'm not sure > what the problem could > be (note: I used the 2.0.2 version downloaded from > the web site). For > the remote messaging, I think there could be a > problem with a firewall, > but I don't understand what the local messaging > problem can be. Could > you try my agents on your machine please? > Moreover, try to connect with a telnet client to the > remote machine on > the 4434 port (or whatever port you are running the > remote aglet > daemon). Finally, what happens if you involve remote > messaging within > the same host, that means running two platforms on > the same host? > > Thanks, > Luca __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |
From: Anil K. <akr...@ya...> - 2005-11-14 05:15:27
Attachments:
LMCreatorAgent.java
LMSlaveAgent.java
|
Hello Luca and All , I am able to send a message from the CreatorAgent to the SlaveAgent ( created by the creator Agent in the same context )in the same host . But I am not able to send a message back to the CreatorAgent from the Slave Agent. How can i achieve this .Please let me know. First i tried getting the proxy it is from the SlaveAgent using .. AgletProxy localProxy = this.getAgletContext().getAgletProxy(getAgletID()); and used .. localProxy.sendMessage(new Message("HELLORECEIVED")); to send message to teh creator. But the message is sent to the Slave Agent itself. Then i tried passing the CreatorAgent proxy to the SlaveAgent and used that in sending the message back. Still i did not receive the message in the CreatorAgent side. I am attaching the simple files i used for complete local messaging. PLease lte me know i f ia m doing some thing wrong. And if you have any other suggestions or any other mechanism that will achieve this functionality of complete messaging please let me know. Attached are source code files (LMCreatorAgent.java & LMSlaveAgent.java ) i used . Appreciate your help on this . Thanks Anil -- Luca Ferrari <cat...@us...> > wrote: > > > Anil Kumar's cat, on 16/10/2005 6.51, walking on > the > > keyboard wrote: > > > I got a compilation error at one import line > > that > > > syas "import > > com.ibm.aglet.message.MessageException; " > > > . > > > There is no com.ibm.aglet.message directory at > > all . > > > So i just removed this "message" directory and > > used > > > " com.ibm.aglet.MessageException; " and > > compilation > > > was successful . > > > > > > (Note : you may need to correct this error and > > upload > > > it again to CVS.) > > > > > > You're right, I had messed up the CVS, please be > > patiente, I'll fix the > > compilation problems in the CVS repository. > > Coming back to your problem, I've tried the > attached > > agents within my > > system and they are working. Since they are > similar > > to yours, I think > > the problem is on your systems, but I'm not sure > > what the problem could > > be (note: I used the 2.0.2 version downloaded from > > the web site). For > > the remote messaging, I think there could be a > > problem with a firewall, > > but I don't understand what the local messaging > > problem can be. Could > > you try my agents on your machine please? > > Moreover, try to connect with a telnet client to > the > > remote machine on > > the 4434 port (or whatever port you are running > the > > remote aglet > > daemon). Finally, what happens if you involve > remote > > messaging within > > the same host, that means running two platforms on > > the same host? > > > > Thanks, > > Luca __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |
From: Anil K. <akr...@ya...> - 2005-11-14 05:47:53
|
Hi Luca, I am just browsing through the "aglets-developer (read-only)" posts and replies on source forge.net. I find one of your reply (solution) post to Mr.PhaniIndhra's request , interesting and looks like it is related to my work. For your easiness i attached the post following to this mail. I have a question on your solution to Mr.PhaniIndhra. In your solution you asked to "exploit an agent (called MangerAgent) as interface to the running tasks, thus incoming agents asks for running tasks to it and and communicate to it when tasks are finished." But how can the in coming agent send a message to the ManagerAgent..? Incoming agent does not know the proxy on which the Manager is running so it can not send the message to the Manager agent. How can we solve this ..? Do you have a mechanism that will tell all the incoming agents about the proxy that the ManagerAgent is running. Appreciate your help on this. Thanks Anil --- Luca Ferrari wrote: > Phani Indhra's cat, on 11/10/2005 6.47, walking on > the keyboard wrote: > > Once the first aglet comes in i create a file > with the name "TASKIDS.txt " , if it is not already > created.And write the task ID to it in a line and > proceed doing the work for the task . > > If "TASKIDS.txt " is already created i read each > line in the file and compare it with the taskdID of > the just arrived aglet. ( Note : Comparision is > for as there can be multiple disict TaskIDs in this > file at a time ) . If taskID does not exist proceed > further with work .If it exists , > > the aglet gets disposed(); > > > > This is a possible solution, but I suggest you to > use a manager agent on > each system. In other words, exploit an agent as > interface to the > running tasks, thus incoming agents asks for running > tasks to it and > communicate to it when tasks are finished. In this > way, you can keep the > table in memory or, in future release, can use other > storing systems > (DBMS) without requiring any changes to the task > agents. > > Hope this helps, > Luca > __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |