Create agent question


Subject: Create agent question
From: Juan C. Martinez (jumartin@etse.urv.es)
Date: Wed Aug 07 2002 - 11:15:17 MET DST


Hello jader's

   I am updating my application from jade 2.4 to jade 2.6. I have an
agent that create others agents, and I am using the following code:

public class AgentCreator extends Agent{

....

   String Name = Txt_Name.getText()

 /* try{ Agentwrk Ag = new Agentwrk(); **** CODE IN JADE 2.4 *****
          Ag.doStart(Name);
       }
      catch (Exception err) {System.out.println("ERROR AL CREAR EL
AGENTE: " + err);} */

   try {PlatformController container = getContainerController(); //
***** CODE JADE 2.6 *****
        AgentController Ag = container.createNewAgent(Name, "Agentwrk",
null);
        Ag.start();
       }
   catch (jade.wrapper.ControllerException err)
{System.out.println("ERROR AL CREAR EL AGENTE: " + err);}

.....

   The commented code is in jade 2.4.

   When I use the code for jade 2.6 the following Exception occurs:

         java.lang.ClassCastException: jade.core.DummyToolkit

   Does any body knows what the problem is????

   Thanks in advance.

--
____________________________________________________

Juan C. Martínez Miranda Departament d'Enginyeria Informàtica i Matemàtiques Escola Tècnica Superior d'Enginyeria Universitat Rovira i Virgili Campus Sescelades Avinguda dels Paìsos Catalans, 26 43007 Tarragona Tel. 977 55 85 16 Fax. 977 55 97 10 E-mail: jumartin@etse.urv.es



This archive was generated by hypermail 2a22 : Wed Aug 07 2002 - 11:24:30 MET DST