简体   繁体   English

JADE 代理 - 异常消息:调度程序错误 - 原因:远程站点中的 DispatcherException。 object-id 没有骨架

[英]JADE agents - Exception message: Dispatcher error - Caused by: DispatcherException in remote site. No skeleton for object-id

I'm attempting setup 2 agents(DFSearchAgent) and another agent that registers a service by type (DFRegisterAgent).我正在尝试设置 2 个代理(DFSearchAgent)和另一个按类型注册服务的代理(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:最初,我使用 JADE GUI 选项在同一个“MainController”中启动 DFSearchAgent 和 DFRegisterAgent,步骤如下: ,右键单击 MainContainer,选择“Start New Agent”,然后从预打包的示例中选择 DFSearchedAgent:

在此处输入图像描述

Console output:控制台 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 .我重复了相同的步骤,将DFSearchAgent添加to the same MainContainer中。

Console output (Search agent was able to find a registered agent. All is good):控制台 output (搜索代理能够找到注册代理。一切都很好):

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).如果我重新尝试上述步骤,但是使用两个不同的容器 1 MainContainer 和 1 个外围设备,那么我会得到一个异常(远程站点中的 DispatcherException。没有 object-id 的骨架)。

Attempt #1 (Using 1 Main-Container, 1 Peripheral Container, same machine) Steps:尝试#1(使用1个主容器,1个外围容器,同一台机器)步骤:

  1. Remove DFSearchAgent & DFRegisterAgent from already running Main-Container从已经运行的主容器中删除 DFSearchAgent 和 DFRegisterAgent

OR或者

Shut down old container & launch a new Main-Container via java jade.Boot -gui关闭旧容器并通过 java jade.Boot -gui启动一个新的主容器

  1. Launch 2nd peripheral container via command line run:通过命令行运行启动第二个外围容器:

    java jade.Boot -gui -container java 玉。引导-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):尝试 2 个步骤(使用 2 个主容器,同一台机器,GUI 命令):

Steps:脚步:

  1. Using 2 different shell/command windows, run使用 2 个不同的 shell/命令 windows,运行

Run in shell #1 java jade.Boot -gui运行在 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运行在 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.启动了两个 GUI,并且有 2 个主容器。

  1. Using GUI add first DFRegisterAgent, then register DFSearchAgent.使用 GUI 首先添加 DFRegisterAgent,然后注册 DFSearchAgent。

1st Console:第一个控制台:

Agent DFRegisterAgent registering service "unknown" of type "weather-forecast"代理 DFRegisterAgent 注册“天气预报”类型的“未知”服务

2nd Console:第二个控制台:

Agent DFSearchAgent searching for services of type "weather-forecast" Agent DFSearchAgent did not find any weather-forecast service代理 DFSearchAgent 搜索类型为“天气预报”的服务 代理 DFSearchAgent 未找到任何天气预报服务

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):尝试 3 个步骤(使用 1 个主容器和 1 个外围容器,同一台机器,shell 命令):

Steps:脚步:

  1. Launch the 1st Main-Container启动第一个主容器

    java jade.Boot -gui java 玉.引导-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
  1. In a new shell,attempt to launch 2nd peripheral container在新的 shell 中,尝试启动第二个外围容器

    java jade.Boot -gui -container java 玉。引导-gui-container

Console output:控制台 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):尝试 4(通过代码):

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.我还尝试通过设置 Java 项目并实例化 DFRegisterAgent 并注册(DFRegisterAgent 在 1 MainContainer 中并实例化 DFSearchAgent 并在 2 MainContainer 中注册 DFSearchAgent)来尝试相同的步骤。

Register the DFRegisterAgent:注册 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:注册 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:我在 2 个单独的 shell windows 中运行了 2 个程序(第一次运行 DFRegisterAgent,然后是 DFSearchAgent),使用:

java -cp target/demo-1.jar com.example.yellowpages.App java -cp target/demo-1.jar com.example.yellowpages.App

1st console output snippet:第一个控制台 output 片段:

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:第二个控制台 output 片段:

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.查看 GUI,两个代理都已注册。

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.在启动外围容器之前,请确保您的 main 已启动并运行,搜索代理位于顶部。

Bye,再见,

Giovanni乔瓦尼

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM