作者xlk (深深)
看板java
标题Re: [问题] 关於jade的运行问题
时间Sun Mar 18 18:12:34 2012
tl;dr
1. example class 没有在classpath 里找到
2. 猜是程式没停止 占用1099 port, windows用工作管理员找到中指它
== Linux mini tutorial
#slowly, svn name/pwd: jade/jade
git svn clone
https://avalon.cselt.it/svn/jade/trunk jade-git
cd jade-git
# 我这 ant 会找不到 demo/CalendarBean.jar
ant -lib demo dist_all
# run example, classpath分隔符号 windows 用; linux 用:
java -cp .:lib/jade.jar:demo/CalendarBean.jar:classes \
jade.Boot -gui -local-host 127.0.0.1 hello:examples.hello.HelloWorldAgent
# run demo
java -jar demo/MeetingScheduler.jar -nomtp -gui \
Tizio:demo.MeetingScheduler.MeetingSchedulerAgent \
Caio:demo.MeetingScheduler.MeetingSchedulerAgent
== Eclipse 设定
main class:
jade.Boot
program arguments:
"-gui -local-host 127.0.0.1 Hello:examples.hello.HelloWorldAgen"
== No ICP active ERROR
出现以下错误时,找出 process 停止或 kill
"""
2012/3/18 下午 05:53:47 jade.imtp.leap.CommandDispatcher addICP
警告: Error adding ICP jade.imtp.leap.JICP.JICPPeer@a4a63d8[Cannot bind
server socket to localhost port 1099].
2012/3/18 下午 05:53:47 jade.core.AgentContainerImpl joinPlatform
严重的: Communication failure while joining agent platform: No ICP active
jade.core.IMTPException: No ICP active
"""
== Resource
http://jade.tilab.com/doc/tutorials/JADEAdmin/startJade.html
http://www.javaworld.com.tw/jute/post/view?bid=11&id=199733&sty=1
※ 引述《ken12517 (向月葵)》之铭言:
: 如题,因为制作专题的关系,需要使用到代理人
: 因此选定jade来做为代理人来运作
: 但我在运行jade官网所提供的范例时
: 一直无法运行成功
: 所以请各位大大帮忙看一下哪边设置有问题,或者是错误
: 参考文章:http://0rz.tw/FPorE
: 基本上都是按照参考文章的方式设定,只是不知道为什麽会出现
: 以下是关於运行的相关资料和程式码、错误讯息
: 运行环境为 jdk1.7.0_01 + eclipse indigo + jade 3.4.1
: 环境变数:
: .;C:\jade\lib\jade.jar;
: C:\jade\lib\jadeTools.jar;
: C:\jade\lib\http.jar;
: C:\jade\lib\iiop.jar;
: C:\jade\lib\commons-codec\commons-codec-1.3.jar
: 运行的范例程式码:
: package examples.hallo;
: import jade.core.Agent;
: /**
: This example show a minimal agent that just prints "Hallo World!"
: and then terminates.
: @author Giovanni Caire - TILAB
: */
: public class HalloWorldAgent extends Agent {
: protected void setup() {
: System.out.println("Hallo World! My name is "+getLocalName());
: // Make this agent terminate
: doDelete();
: }
: }
: 错误讯息有两个(有点长....):
: 1.第一次执行会出现
: 三月 17, 2012 5:07:04 下午 jade.core.Runtime beginContainer
: 资讯: ----------------------------------
: This is JADE 3.4.1 - revision 5912 of 2006/11/16 13:09:18
: downloaded in Open Source, under LGPL restrictions,
: at http://jade.tilab.com/
: ----------------------------------------
: 三月 17, 2012 5:07:06 下午 jade.core.BaseService init
: 资讯: Service jade.core.management.AgentManagement initialized
: 三月 17, 2012 5:07:06 下午 jade.core.BaseService init
: 资讯: Service jade.core.messaging.Messaging initialized
: 三月 17, 2012 5:07:06 下午 jade.core.BaseService init
: 资讯: Service jade.core.mobility.AgentMobility initialized
: 三月 17, 2012 5:07:06 下午 jade.core.BaseService init
: 资讯: Service jade.core.event.Notification initialized
: 三月 17, 2012 5:07:06 下午 jade.mtp.http.HTTPServer <init>
: 资讯: HTTP-MTP Using XML parser
: com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
: 三月 17, 2012 5:07:06 下午 jade.core.messaging.MessagingService boot
: 资讯: MTP addresses:
: http://E801Lab-PC:7778/acc
: 三月 17, 2012 5:07:06 下午 jade.core.AgentContainerImpl startBootstrapAgents
: 严重: Cannot create agent Hallo: Class examples.hallo.HalloWorldAgent for
: agent ( agent-identifier :name Hallo@E801Lab-PC:1099/JADE ) not found [nested
: java.lang.ClassNotFoundException: examples.hallo.HalloWorldAgent]
: 三月 17, 2012 5:07:06 下午 jade.core.AgentContainerImpl joinPlatform
: 资讯: --------------------------------------
: Agent container Main-Container@JADE-IMTP://E801Lab-PC is ready.
: --------------------------------------------
: 会出现一个严重:Cannot create agent Hallo: Class examples.hallo.HalloWorldAgent for
: agent ( agent-identifier :name Hallo@E801Lab-PC:1099/JADE ) not found [nested
: java.lang.ClassNotFoundException: examples.hallo.HalloWorldAgent]
: 想请问这要如何解决???
: 2.再来是有时候也会出现下面这个情况,想请问要如何解决???
: 三月 17, 2012 4:43:26 下午 jade.core.AgentContainerImpl joinPlatform
: 严重: Some problem occurred while joining agent platform.
: jade.core.ProfileException: Can't get a proxy to the Platform Manager [nested
: jade.core.IMTPException: The Service Manager was already bound in the RMI
: Registry [nested java.rmi.AlreadyBoundException: ServiceManager]]
: at jade.core.ProfileImpl.createPlatformManager(Unknown Source)
: at jade.core.ProfileImpl.getPlatformManager(Unknown Source)
: at jade.core.ProfileImpl.getServiceManager(Unknown Source)
: at jade.core.AgentContainerImpl.init(Unknown Source)
: at jade.core.AgentContainerImpl.joinPlatform(Unknown Source)
: at jade.core.Runtime.createMainContainer(Unknown Source)
: at jade.Boot.<init>(Unknown Source)
: at jade.Boot.main(Unknown Source)
: Nested Exception:
: jade.core.IMTPException: The Service Manager was already bound in the RMI
: Registry [nested java.rmi.AlreadyBoundException: ServiceManager]
: at jade.imtp.rmi.RMIIMTPManager.exportPlatformManager(Unknown Source)
: at jade.core.ProfileImpl.createPlatformManager(Unknown Source)
: at jade.core.ProfileImpl.getPlatformManager(Unknown Source)
: at jade.core.ProfileImpl.getServiceManager(Unknown Source)
: at jade.core.AgentContainerImpl.init(Unknown Source)
: at jade.core.AgentContainerImpl.joinPlatform(Unknown Source)
: at jade.core.Runtime.createMainContainer(Unknown Source)
: at jade.Boot.<init>(Unknown Source)
: at jade.Boot.main(Unknown Source)
: Nested Exception:
: java.rmi.AlreadyBoundException: ServiceManager
: at sun.rmi.registry.RegistryImpl.bind(RegistryImpl.java:153)
: at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
: at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
: at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
: at sun.rmi.transport.Transport$1.run(Transport.java:177)
: at sun.rmi.transport.Transport$1.run(Transport.java:174)
: at java.security.AccessController.doPrivileged(Native Method)
: at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
: at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
: at
: sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
: at
: sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
: at
: java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
: at
: java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
: at java.lang.Thread.run(Thread.java:722)
: at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown
: Source)
: at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
: at sun.rmi.server.UnicastRef.invoke(Unknown Source)
: at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
: at java.rmi.Naming.bind(Unknown Source)
: at jade.imtp.rmi.RMIIMTPManager.exportPlatformManager(Unknown Source)
: at jade.core.ProfileImpl.createPlatformManager(Unknown Source)
: at jade.core.ProfileImpl.getPlatformManager(Unknown Source)
: at jade.core.ProfileImpl.getServiceManager(Unknown Source)
: at jade.core.AgentContainerImpl.init(Unknown Source)
: at jade.core.AgentContainerImpl.joinPlatform(Unknown Source)
: at jade.core.Runtime.createMainContainer(Unknown Source)
: at jade.Boot.<init>(Unknown Source)
: at jade.Boot.main(Unknown Source)
: 三月 17, 2012 4:43:26 下午 jade.core.Runtime$1 run
: 资讯: JADE is closing down now.
: 麻烦大大解答了,谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.32.40.176
※ 编辑: xlk 来自: 114.32.40.176 (03/18 18:22)
※ 编辑: xlk 来自: 114.32.40.176 (03/18 19:51)
1F:推 ken12517:谢谢,後来尝试了,发现是eclipse设定的问题 03/19 03:06
2F:→ ken12517:是这部分program arguments设定错误,谢谢除错 03/19 03:08