Bonjour,
Je vous remercie pour les tutoriels
j'ai essayé le programme de communication, et l'AgentB ne se lancer pas
L'exécution du programme :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| ---------------------------------------
----------------agent A----------------
---------------------------------------
en attente de l agent B
----------------agent B----------------
*** Uncaught Exception for agent a2 ***
java.lang.NumberFormatException: For input string: "( (action ( agent-identifier :name a2@176.64.0.18:1099/JADE :addresses (sequence http://auchan-PC:7778/acc )) (ACLMessage) ) (MTS-error ( agent-identifier :name AgentA@176.64.0.18:1099/JADE ) (internal-error "Agent not found: getContainerID() failed to find agent AgentA@176.64.0.18:1099/JADE")) )"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
ERROR: Agent a2 died without being properly terminated !!!
State was 2
at java.lang.Integer.parseInt(Integer.java:499)
at communication.AgentB$afficher.action(AgentB.java:61)
at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:344)
at jade.core.behaviours.CompositeBehaviour.action(CompositeBehaviour.java:109)
at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:344)
at jade.core.Agent$ActiveLifeCycle.execute(Agent.java:1500)
at jade.core.Agent.run(Agent.java:1439)
at java.lang.Thread.run(Thread.java:662) |
j'utilise Netbeans, au début j'ai lancé AgentA puis Agent B, par la suite j'ai les lancé les deux agents en meme temps comme indiqué dans la première page, et toujours la meme erreur
1 2 3 4 5 6 7 8
| try {
AgentController a1 = ac.createNewAgent("a1", "communication.AgentA", null);
a1.start();
AgentController a2 = ac.createNewAgent("a2", "communication.AgentB", null);
a2.start();
} catch (StaleProxyException ex) {
Logger.getLogger(pricipale.class.getName()).log(Level.SEVERE, null, ex);
} |
j'ai aussi essayé de lancer les agents à partir de la ligne de commandes, j'ai fait:
java -cp C:\jade\lib\jade.jar;. jade.Boot -gui -agents a1:AgentA a2:AgentB
et il y avait un autre message d'erreur:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| ATTENTION: WARNING: overriding agents specification set with the "-agents" option
2 fÚvr. 2012 11:20:26 jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE snapshot - revision 6357 of 2010/07/06 16:27:34
downloaded in Open Source, under LGPL restrictions,
at <a href="http://jade.tilab.com/" target="_blank">http://jade.tilab.com/</a>
----------------------------------------
Retrieving CommandDispatcher for platform null
2 fÚvr. 2012 11:20:26 jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://176.64.0.18:1099
2 fÚvr. 2012 11:20:26 jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
2 fÚvr. 2012 11:20:26 jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
2 fÚvr. 2012 11:20:26 jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
2 fÚvr. 2012 11:20:26 jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
2 fÚvr. 2012 11:20:26 jade.core.messaging.MessagingService clearCachedSlice
INFO: Clearing cache
2 fÚvr. 2012 11:20:27 jade.mtp.http.HTTPServer <init>
INFO: HTTP-MTP Using XML parser com.sun.org.apache.xerces.internal.jaxp.SAXParse
rImpl$JAXPSAXParser
2 fÚvr. 2012 11:20:27 jade.core.messaging.MessagingService boot
INFO: MTP addresses:
<a href="http://auchan-PC:7778/acc" target="_blank">http://auchan-PC:7778/acc</a>
2 fÚvr. 2012 11:20:27 jade.core.AgentContainerImpl joinPlatform
INFO: --------------------------------------
Agent container Main-Container@176.64.0.18 is ready.
--------------------------------------------
----------------agent B----------------
*** Uncaught Exception for agent a2 ***
java.lang.NumberFormatException: For input string: "( (action ( agent-identifier
:name a2@176.64.0.18:1099/JADE :addresses (sequence <a href="http://auchan-PC:7778/acc" target="_blank">http://auchan-PC:7778/acc</a>
)) (ACLMessage) ) (MTS-error ( agent-identifier :name AgentA@176.64.0.18:1099/JA
DE ) (internal-error "Agent not found: getContainerID() failed to find agent Age
ntA@176.64.0.18:1099/JADE")) )"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at AgentB$afficher.action(AgentB.java:61)
at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:344)
at jade.core.behaviours.CompositeBehaviour.action(CompositeBehaviour.jav
a:109)
at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:344)
at jade.core.Agent$ActiveLifeCycle.execute(Agent.java:1500)
at jade.core.Agent.run(Agent.java:1439)
at java.lang.Thread.run(Unknown Source)
ERROR: Agent a2 died without being properly terminated !!!
State was 2
2 fÚvr. 2012 11:20:27 jade.core.messaging.MessagingService removeLocalAliases
INFO: Removing all local alias entries for agent a2
2 fÚvr. 2012 11:20:27 jade.core.messaging.MessagingService removeGlobalAliases
INFO: Removing all global alias entries for agent a2 |
Partager