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

问题描述

我正在尝试设置 2 个代理 (DFSearchAgent) 和另一个按类型注册服务的代理 (DFRegisteragent)。

但是,我无法启动“外围容器”或承载第二个代理的额外容器。

假设:

最初,我使用 JADE GUI 选项和步骤在同一个“MainController”中启动 DFSearchAgent 和 DFRegisteragent:,右键单击 MainContainer ,选择“Start New Agent”,然后从 pre 中选择 DFSearchedAgent -打包示例:

enter image description here

控制台输出

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

我重复了添加 DFSearchAgentto the same MainContainer 的相同步骤。

控制台输出搜索代理能够找到注册代理。一切正常):

Agent DFSearchAgent found the following weather-forecast services:
Service "unkNown" provided by agent DFRegisteragent@137.79.225.104:1099/JADE

问题来了...

如果我重新尝试上述步骤,但是使用两个不同的容器 1 MainContainer 和 1 个外设,那么我会收到异常(远程站点中的 dispatcherException。没有对象 ID 的框架)。

尝试 #1(使用 1 个主容器、1 个外围容器、同一台机器)步骤:

  1. 从已经运行的 Main-Container 中删除 DFSearchAgent 和 DFRegisteragent

关闭旧容器并通过 java jade.Boot -gui 启动一个新的主容器

  1. 通过命令行运行启动第二个外围容器:

    java jade.Boot -gui -container

或在启动时提供代理

java jade.Boot -gui -container provider:examples.yellowPages.DFRegisteragent my-forecast

控制台异常:

Exception message: dispatcher error - Caused by:  dispatcherException in remote site. No skeleton for object-id 15724561

尝试 2 个步骤(使用 2 个主容器、同一台机器、GUI 命令):

步骤:

  1. 使用 2 个不同的 shell/命令窗口,运行

在 shell #1 java jade.Boot -gui

中运行

一个控制台的片段:

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,2021 2:50:27 PM jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://137.79.225.104:1099

在 shell #2 java jade.Boot -gui

中运行

第二个控制台的片段:

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,2021 2:50:40 PM jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://137.79.225.104:1099

启动了两个 GUI,有 2 个主要容器。

  1. 使用 GUI 首先添加 DFRegisteragent,然后注册 DFSearchAgent。

一个控制台:

代理 DFRegisteragent 注册“天气预报”类型的服务“未知”

第二个控制台:

代理 DFSearchAgent 搜索“天气预报”类型的服务 Agent DFSearchAgent 没有找到任何天气预报服务

问题/问题:虽然没有任何异常,但搜索代理找不到注册代理。

尝试 3 个步骤(使用 1 个主容器和 1 个外围容器、同一台机器、shell 命令):

步骤:

  1. 启动第一个主容器

    java jade.Boot -gui

控制台输出

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,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. 一个新的 shell 中,尝试启动第二个外围容器

    java jade.Boot -gui -container

控制台输出

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]

尝试 4(通过代码):

我还尝试通过设置 Java 项目并实例化 DFRegisteragent 并注册(1 个 MainContainer 中的 DFRegisteragent & 实例化 DFSearchAgent 并在 2 个 MainContainer 中注册 DFSearchAgent)来尝试相同的步骤。

注册 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..." );
    }
}

注册 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..." );
        
}
}

我在 2 个单独的 shell 窗口中运行了 2 个程序(第一个运行了 DFRegisteragent,然后是 DFSearchAgent),使用:

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

一个控制台输出片段:

Agent container Main-Container@137.79.225.104 is ready.
--------------------------------------------
Test is complete...
Agent DFRegisteragent registering service "unkNown" of type "weather-forecast"

第二个控制台输出片段:

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

查看 GUI,两个代理都已注册

当代理在单独的容器中注册时,代理无法相互看到,我无法启动外围容器作为解决方法

如何修复搜索代理以查找注册代理?

赞赏。

解决方法

您报告的错误发生在您启动外围容器而主容器尚未处于活动状态时。 在启动带有顶部搜索代理的外围容器之前,请确保您的主要功能已启动并正在运行。

再见,

乔瓦尼

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...