2012-02-14 90 views
4

我是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的早期版本,但再次,沒有運氣。任何幫助將非常感激。

非常感謝

回答

0

看來,我把「jade.jar」和「commons-codec-1.3.jar」的位置問題(我最初把它們放在/ Library/Java/Extensions(在OSX獅子中))。我嘗試刪除它們,將它們放在其他地方並再次嘗試,現在它可以正常工作。不完全確定爲什麼介意!

4

你需要在啓動時通過類的全名。在我的舊版本的JADE上,HelloWorldAgent位於examples.hello包中。因此你應該指定程序參數:-gui testAgent:examples.hello.HelloWorldAgent

+0

+1:另外我需要添加的路徑我agentclass在類路徑'java -cp〜/ JADE/lib/jade.jar:〜/ JADE/helloworldagent /:jade.Boot testAgent:HelloAgent'中。 – PCoder 2013-10-23 09:24:58

2

類名稱前只需添加包名稱

-gui testAgent:packageName.HelloWorldAgent

0

您需要添加:

-gui nameAgent:packageName.className