RE: [jade-develop] Find existing agents


Subject: RE: [jade-develop] Find existing agents
From: Petr Charvat (charvat@labe.felk.cvut.cz)
Date: Fri Jan 10 2003 - 10:25:36 MET


Hi,
 I think, your code is not possilbe to compile, because you want to call
method, that throws exception and there is no catch statement.
Petr
  -----Original Message-----
  From: jade-develop-admin@sharon.cselt.it
[mailto:jade-develop-admin@sharon.cselt.it]On Behalf Of Duc Duong
  Sent: Friday, January 10, 2003 3:21 AM
  To: jade-develop@sharon.cselt.it
  Subject: [jade-develop] Find existing agents

  Hi jaders,
  I'm trying to find all existing agents by the following code, but i got an
eror, can anyone tell me how I can do now??? thanks a lot :-)
  code:

  DFAgentDescription dfd = new DFAgentDescription();
  ServiceDescription sd = new ServiceDescription();
  sd.setType("BroadcastAgent");
  sd.setName(getName());
  sd.setOwnership("DucDuong");
  dfd.setName(getAID());
  dfd.addServices(sd);
  DFService.register(this,dfd);
  DFAgentDescription[] AgentList = search(this, getAID(), dfd);

  error:
  BroadcastAgent.java:71: unreported exception jade.domain.FIPAException;
must be
  caught or declared to be thrown
      DFAgentDescription[] AgentList = DFService.search(this,getAID(), dfd);
                                                                      ^

  - Beginner

Hi,
 I think, your code is not possilbe to compile, because you want to call method, that throws exception and there is no catch statement.
Petr
-----Original Message-----
From: jade-develop-admin@sharon.cselt.it [mailto:jade-develop-admin@sharon.cselt.it]On Behalf Of Duc Duong
Sent: Friday, January 10, 2003 3:21 AM
To: jade-develop@sharon.cselt.it
Subject: [jade-develop] Find existing agents

Hi jaders,
I'm trying to find all existing agents by the following code, but i got an eror, can anyone tell me how I can do now??? thanks a lot :-)
code:
 
DFAgentDescription dfd = new DFAgentDescription();
ServiceDescription sd = new ServiceDescription();
sd.setType("BroadcastAgent");
sd.setName(getName());
sd.setOwnership("DucDuong");
dfd.setName(getAID());
dfd.addServices(sd);
DFService.register(this,dfd);
DFAgentDescription[] AgentList = search(this, getAID(), dfd);
 
error:
BroadcastAgent.java:71: unreported exception jade.domain.FIPAException; must be
caught or declared to be thrown
    DFAgentDescription[] AgentList = DFService.search(this,getAID(), dfd);
                                                                    ^
 
- Beginner



This archive was generated by hypermail 2a22 : Fri Jan 10 2003 - 10:23:09 MET