Search code examples
agentsagents-jade

JADE IPMS Inter-Platform Agent Migration


I'm using IPMS with Jade for inter-platform agent migration. I'm using Jade 3.6 with IPMS 1.2. I have enabled the services on both slave1 (the original platform) and on slave2 (the target platform). The -accept-foreign-agents true option is also set on both platform. I've increased the timeout settings as well. The code for migration is as follows:

AID remoteAMS = new AID("ams@slave2:1099/JADE", AID.ISGUID);
remoteAMS.addAddresses("http://slave2:7778/acc");
PlatformID destination = new PlatformID(remoteAMS);
agent.doMove(destination);

I was only getting a timeout on slave1 but after enabling detailed logging, I'm getting the following error on slave2:

WARNING: FAILURE-ams-9 - Receiver does not exist.
jade.core.NotFoundException: getContainerID() failed to find agent ams@slave1
    at jade.core.MainContainerImpl.getContainerID(MainContainerImpl.java:1318)
    at jade.core.messaging.MessagingService.deliverInLocalPlatfrom(MessagingService.java:1255)
    at jade.core.messaging.MessagingService.deliverNow(MessagingService.java:1187)
    at jade.core.messaging.MessageManager$Deliverer.run(MessageManager.java:152)
    at java.lang.Thread.run(Thread.java:662)

Any hints on how to debug this?


Solution

  • This problem is caused by not having the proper hostnames set on the platforms. JADE needs to be able to resolve 127.0.0.1 to 'slave1' on host and 'slave2' on target platforms. To fix this problem, I edited my /etc/hosts file and commented out localhost on both systems:

    # 127.0.0.1     localhost 
    127.0.0.1       slave1 
    192.168.56.101  slave2
    

    Same goes for slave2. I've covered this and some other errors in a detailed tutorial here: Agent Mobility with JADE and JIPMS.