JADE找不到代理
问题描述:
我是JADE的新手,并且在加载代理时遇到了一些问题。JADE找不到代理
我创建了一个新的IntelliJ项目,并在“Dependencies”中添加了“jade.jar”和“commons-codec-1.3.jar”(我使用JADE 4.1.1)并勾选了导出框也试过没有他们打勾)。然后我将示例中的“HelloWorldAgent.java”添加到了src中。我设置了运行配置为:
- 主类:jade.Boot
- 程序参数:-gui testAgent:HelloWorldAgent模块的
- 使用类路径:jadeCW(我的项目名称)
当我使用这个配置运行时,JADE的人确实启动了,但没有找到“HelloWorldAgent”。输出是:
14-Feb-2012 21:43:08 jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE 4.1.1 - revision 6532 of 2011/11/18 16:21:34
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
Retrieving CommandDispatcher for platform null
14-Feb-2012 21:43:08 jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://192.168.1.66:1099
14-Feb-2012 21:43:08 jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
14-Feb-2012 21:43:08 jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
14-Feb-2012 21:43:08 jade.core.BaseService init
INFO: Service jade.core.resource.ResourceManagement initialized
14-Feb-2012 21:43:08 jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
14-Feb-2012 21:43:08 jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
14-Feb-2012 21:43:08 jade.mtp.http.HTTPServer <init>
INFO: HTTP-MTP Using XML parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
14-Feb-2012 21:43:08 jade.core.messaging.MessagingService boot
INFO: MTP addresses: http://unknown-00-19-c5-7e-cb-4b.home:7778/acc
14-Feb-2012 21:43:08 jade.core.AgentContainerImpl startBootstrapAgents
SEVERE: Cannot create agent testAgent: Class HelloWorldAgent for agent (agent-identifier :name [email protected]:1099/JADE) not found [nested java.lang.ClassNotFoundException: HelloWorldAgent]
14-Feb-2012 21:43:08 jade.core.AgentContainerImpl joinPlatform
INFO: --------------------------------------
Agent container [email protected] is ready.
关键的问题是清楚的:
SEVERE: Cannot create agent testAgent: Class HelloWorldAgent for agent (agent-identifier :name [email protected]:1099/JADE) not found [nested java.lang.ClassNotFoundException: HelloWorldAgent]
我试过用食,但我得到了同样的问题,我也尝试过使用JADE的早期版本,但再次,没有运气。任何帮助将非常感激。
非常感谢
丹
答
看来,我把“jade.jar”和“commons-codec-1.3.jar”的位置问题(我最初把它们放在/ Library/Java/Extensions(在OSX狮子中))。我尝试删除它们,将它们放在其他地方并再次尝试,现在它可以正常工作。不完全确定为什么介意!
答
你需要在启动时通过类的全名。在我的旧版本的JADE上,HelloWorldAgent
位于examples.hello
包中。因此你应该指定程序参数:-gui testAgent:examples.hello.HelloWorldAgent
。
答
类名称前只需添加包名称
-gui testAgent:packageName.HelloWorldAgent
答
您需要添加:
-gui nameAgent:packageName.className
+1:另外我需要添加的路径我agentclass在类路径'java -cp〜/ JADE/lib/jade.jar:〜/ JADE/helloworldagent /:jade.Boot testAgent:HelloAgent'中。 – PCoder 2013-10-23 09:24:58