[英]Jade Framework (two containers)
我有在同一台主机(我的笔记本电脑)上使用 Jade 的专业知识,因为我可以处理代理之间的所有交互; 但是我必须在笔记本电脑中运行MainContainer
,在 Raspberry Pi 中运行第二个容器。 我开始尝试一个简单的例子,创建 2 个代理,第一个在主容器上,第二个在将在 Raspberry Pi 上运行的容器上。 但它不起作用。
以下代码用于包含 agent1 的主容器,它将向 agent2 发送消息
Runtime runtime = Runtime.instance();
Properties properties = new ExtendedProperties();
properties.setProperty(Profile.GUI, "true");
Profile profile = new ProfileImpl(properties);
AgentContainer agentContainer1=runtime.createMainContainer(profile);
Container.start();
AgentController agent1=agentContainer1.createNewAgent("Agent1","Connexion.Agent1",new Object[]{});
agent1.start();
第二个容器的代码:
Runtime runtime=Runtime.instance();
Profile profile=new ProfileImpl();
profile.setParameter(profile.MAIN_HOST, "192.168.0.164"); //Raspberry Pi host
AgentContainer agentContainer1=runtime.createAgentContainer(profile);
AgentController agent2=agentContainer1.createNewAgent("Agent2","Connexion.Agent2",new Object[]{});
agent2.start();
agentContainer1.start();
主容器代码没有任何问题,但是当我使用deployAndBrickPun
( ev3dev-lang-java
) 运行deployAndBrickPun
容器时,它显示以下错误:
> Task :deploy
Host key checking is off. It may be vulnerable to man-in-the-middle attacks.
ev3dev#1|Sep 20, 2021 1:27:00 PM jade.core.AgentContainerImpl joinPlatform
ev3dev#1|SEVERE: Some problem occurred while joining agent platform.
ev3dev#1|jade.core.ProfileException: Can't get a proxy to the Platform Manager - Caused by: Dispatcher error - Caused by: DispatcherException in remote site. No skeleton for object-id0
ev3dev#1| at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:529)
ev3dev#1| at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:442)
ev3dev#1| at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:456)
ev3dev#1| at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:347)
ev3dev#1| at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:495)
ev3dev#1| at jade.core.Runtime.createAgentContainer(Runtime.java:127)
ev3dev#1| at Connexion.Container1.main(Container1.java:17)
我需要解决这个错误,所以我请求你的帮助;
先感谢您。
您的个人资料中缺少信息。
您需要在两者(主容器和远程容器)上定义 IP、端口、主机名。 不在 main-c 上执行此操作将创建 pb 以供其运行,但您将无法从 pi 加入它。
pi 容器上给出的 IP 应该是主容器之一。 不确定在您的示例中是否是这种情况。
您可以查看打算提供几个运行示例的开源项目startJade 。 “平台创建”示例涵盖了这种情况。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.