小第毕设做有关多Agent通信研究。第一次接触JADE,但出现一个问题一直解决不了,我是利用的是netbeans5.0写的java程序,jade是3.4版本,源程序如下: 运行时,会弹出jade rma运行窗口,但netbeans下面的输出框中没有打印出结果信息。
并且出现下面这个错误 :"严重: Cannot create agent hello: Class jadetest.HelloWorldAgent for agent ( agent-identifier :name hello@yourcomputer:1099/JADE ) not found [nested java.lang.ClassNotFoundException: jadetest.HelloWorldAgent]"到底是什么原因? netbeans和jade3.4我已经绑定了,希望知晓者来帮帮忙!!!
import jade.core.*;
public class HelloWorldAgent extends Agent{
  public void setup(){
    System.out.println("Agent Started: Hello World!");
    System.out.println("-----About Me:-----");
    System.out.println("My local name is:"+getLocalName());
    System.out.println("My globally unique name is:"+getName() );
    System.out.println("-----About Here:-----");
    Location l = here();
    System.out.println("I am running in a location called:"+l.getName());
    System.out.println("Which is identified uniquely as:"+l.getID());
    System.out.println("And is contactable at:"+l.getAddress());
    System.out.println("Using the protocol:"+l.getProtocol());
  }
}
下面是运行得出的一些信息:
init:deps-jar:compile:run:2007-4-8 20:45:57 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/----------------------------------------2007-4-8 20:45:59 jade.core.BaseService init信息: Service jade.core.management.AgentManagement initialized2007-4-8 20:45:59 jade.core.BaseService init信息: Service jade.core.messaging.Messaging initialized2007-4-8 20:45:59 jade.core.BaseService init信息: Service jade.core.mobility.AgentMobility initialized2007-4-8 20:45:59 jade.core.BaseService init信息: Service jade.core.event.Notification initialized2007-4-8 20:45:59 jade.mtp.http.HTTPServer <init>信息: HTTP-MTP Using XML parser org.apache.crimson.parser.XMLReaderImpl2007-4-8 20:45:59 jade.core.messaging.MessagingService boot信息: MTP addresses:http://yourcomputer:7778/acc2007-4-8 20:45:59 jade.core.AgentContainerImpl startBootstrapAgents严重: Cannot create agent hello: Class jadetest.HelloWorldAgent for agent ( agent-identifier :name hello@yourcomputer:1099/JADE ) not found [nested java.lang.ClassNotFoundException: jadetest.HelloWorldAgent]2007-4-8 20:45:59 jade.core.AgentContainerImpl joinPlatform信息: --------------------------------------Agent container Main-Container@JADE-IMTP://yourcomputer is ready.--------------------------------------------

解决方案 »

  1.   

    我的论文也是要用到JADE呵呵,你的是类没找到,我的建议是在Command中运行,你这个多半是没指定哪个包名什么的
      

  2.   

    没有找到 jadetest.HelloWorldAgent类
    在rma中创建Agent时,在class窗口填写你这个类所在的完整包名
      

  3.   

    比如运行jade自带的例子helloworld
    package为examples.hello
    则class窗口需要填入examples.hello.helloWorldAGent
      

  4.   

    你在运行的时候,把自变量的设置改成:
    -gui hello:src.HelloWorldBehaviours
    就可以了