I'm attempting setup 2 agents(DFSearchAgent) and another agent that registers a service by type (DFRegisterAgent).
However, I cannot launch "peripheral container" or an extra container that hosts a 2nd agent.
Assumptions:
Initially, I launch DFSearchAgent and DFRegisterAgent in the same "MainController" using the JADE GUI options with steps: , right click, MainContainer, chose "Start New Agent", then selected DFSearchedAgent from the pre-packaged examples:
Console output:
INFO: ----------------------------------
This is JADE 4.5.0 - revision 6825 of 23-05-2017 10:06:04
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
May 28, 2021 2:01:59 PM jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://137.79.225.104:1099
May 28, 2021 2:02:00 PM jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
May 28, 2021 2:02:00 PM jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
May 28, 2021 2:02:00 PM jade.core.BaseService init
INFO: Service jade.core.resource.ResourceManagement initialized
May 28, 2021 2:02:00 PM jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
May 28, 2021 2:02:00 PM jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
May 28, 2021 2:02:00 PM jade.mtp.http.HTTPServer <init>
INFO: HTTP-MTP Using XML parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
May 28, 2021 2:02:00 PM jade.core.messaging.MessagingService boot
INFO: MTP addresses:
http://XYZ-064067.xyz.abc.gov:7778/acc
May 28, 2021 2:02:00 PM jade.core.AgentContainerImpl joinPlatform
INFO: --------------------------------------
Agent container Main-Container@137.79.225.104 is ready.
--------------------------------------------
Agent DFRegisterAgent registering service "unknown" of type "weather-forecast
I repeated the same steps for adding the DFSearchAgent
, to the same MainContainer
.
Console output (Search agent was able to find a registered agent. All is good):
Agent DFSearchAgent found the following weather-forecast services:
Service "unknown" provided by agent DFRegisterAgent@137.79.225.104:1099/JADE
Now to the problem...
If I re-attempt the above steps, however with two different containers 1 MainContainer and 1 peripheral, then I get an exception (DispatcherException in remote site. No skeleton for object-id).
Attempt #1 (Using 1 Main-Container, 1 Peripheral Container, same machine) Steps:
OR
Shut down old container & launch a new Main-Container via java jade.Boot -gui
Launch 2nd peripheral container via command line run:
java jade.Boot -gui -container
OR provide agent at startup
java jade.Boot -gui -container provider:examples.yellowPages.DFRegisterAgent my-forecast
Exception from console:
Exception message: Dispatcher error - Caused by: DispatcherException in remote site. No skeleton for object-id 15724561
Attempt 2 steps (using 2 Main-Containers, same machine, GUI commands):
Steps:
Run in shell #1 java jade.Boot -gui
Snippet of 1st console out:
May 28, 2021 2:50:27 PM jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE 4.5.0 - revision 6825 of 23-05-2017 10:06:04
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
May 28, 2021 2:50:27 PM jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://137.79.225.104:1099
Run in shell #2 java jade.Boot -gui
Snippet of 2st console out:
May 28, 2021 2:50:40 PM jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE 4.5.0 - revision 6825 of 23-05-2017 10:06:04
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
May 28, 2021 2:50:40 PM jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://137.79.225.104:1099
Two GUIs were launched, and there are 2 main containers.
1st Console:
Agent DFRegisterAgent registering service "unknown" of type "weather-forecast"
2nd Console:
Agent DFSearchAgent searching for services of type "weather-forecast" Agent DFSearchAgent did not find any weather-forecast service
Issue/Problem: Although there were not any exceptions, the search agent could not find a registered agent.
Attempt 3 steps (using 1 Main-Container & 1 peripheral container, same machine, shell commands):
Steps:
Launch the 1st Main-Container
java jade.Boot -gui
Console ouput:
May 28, 2021 3:02:15 PM jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE 4.5.0 - revision 6825 of 23-05-2017 10:06:04
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
May 28, 2021 3:02:15 PM jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://137.79.225.104:1099
In a new shell,attempt to launch 2nd peripheral container
java jade.Boot -gui -container
Console output:
jade.core.IMTPException: jade.core.IMTPException occurred in remote container [Main container cannot reach newly starting node [Container-1, 179334, jicp://137.79.225.104:1099]: Dispatcher error - Caused by: DispatcherException in remote site. No skeleton for object-id 179334]
Attempt 4 (via code):
I also attempt the same steps by setting up Java projects and instantiating the DFRegisterAgent and register (DFRegisterAgent in 1 MainContainer & instantiating the DFSearchAgent and register DFSearchAgent in 2 MainContainer.
Register the DFRegisterAgent:
package com.example.yellowpages;
import jade.util.leap.*;
import jade.core.Profile;
import jade.core.ProfileImpl;
import jade.wrapper.*;
/**
* Hello world!
*/
public final class App {
private App() {
}
/**
* Says hello to the world.
* @param args The arguments of the program.
*/
public static void main(String[] args) {
System.out.println( "Start test..." );
Properties pp = new Properties();
pp.setProperty(Profile.GUI, Boolean.TRUE.toString());
Profile p = new ProfileImpl(pp);
jade.wrapper.AgentContainer ac = jade.core.Runtime.instance().createMainContainer(p);
try {
ac.acceptNewAgent("DFRegisterAgent",new DFRegisterAgent()).start();
} catch (StaleProxyException e) {
throw new Error(e);
}
System.out.println( "Test is complete..." );
}
}
Register DFSearchAgent:
package com.example.yellowpages;
import jade.util.leap.*;
import jade.core.Profile;
import jade.core.ProfileImpl;
import jade.wrapper.*;
/**
* Hello world!
*/
public final class App {
private App() {
}
/**
* Says hello to the world.
* @param args The arguments of the program.
*/
public static void main(String[] args) {
System.out.println( "Start test..." );
Properties pp = new Properties();
pp.setProperty(Profile.GUI, Boolean.TRUE.toString());
Profile p = new ProfileImpl(pp);
jade.wrapper.AgentContainer ac = jade.core.Runtime.instance().createMainContainer(p);
try {
ac.acceptNewAgent("DFSearchAgent",new DFSearchAgent()).start();
ac.acceptNewAgent("DFSubscribeAgent",new DFSubscribeAgent()).start();
} catch (StaleProxyException e) {
throw new Error(e);
}
System.out.println( "Test is complete..." );
}
}
I ran 2 programs, in 2 separate shell windows (1st ran the DFRegisterAgent, then the DFSearchAgent) using:
java -cp target/demo-1.jar com.example.yellowpages.App
1st console output snippet:
Agent container Main-Container@137.79.225.104 is ready.
--------------------------------------------
Test is complete...
Agent DFRegisterAgent registering service "unknown" of type "weather-forecast"
2nd console output snippet:
INFO: --------------------------------------
Agent container Main-Container@137.79.225.104 is ready.
--------------------------------------------
Agent DFSearchAgent searching for services of type "weather-forecast"
Test is complete...
Agent DFSearchAgent did not find any weather-forecast service
Looking at the GUI, both agents were registered.
The agents cannot see each other, when the agents are registered in separate containers & I cannot launch a peripheral container as a workaround.
How can I fix the search agent to find a registered agent?
Appreciated.
The error you report occurs when you launch a peripheral container without a main already active. Be sure your main is up and running before starting the peripheral container with the search agent on top.
Bye,
Giovanni
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.