IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Programmation par agent Java Discussion :

Lancer un agent à partir d'une page JSP


Sujet :

Programmation par agent Java

  1. #1
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2012
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Juillet 2012
    Messages : 11
    Points : 19
    Points
    19
    Par défaut Lancer un agent à partir d'une page JSP
    Bonjour,

    J'aimerais exécuter mon agent de la plateforme Jade, à partir d'une page JSP.

    Voila le code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <%@ page import="jade.core.*" %>
    <%@ page import="javax.naming.InitialContext" %>
    <%@ page import="jade.wrapper.AgentContainer" %>
    <%@ page import="jade.core.Profile" %>
    <%@ page import="jade.core.ProfileImpl" %>
    <%@ page import="jade.wrapper.AgentController" %>
    <%@ page import="jade.wrapper.*" %>
    <%@ page import="migre.agent_migration" %>
    <%@ page import="jade.core.Runtime" %>
    <% 
    System.out.println("test0");
    try{
        String [] args ={"-agents","mob:migre.agent_migration","-services","jade.core.mobility.AgentMobilityService;jade.core.migration.InterPlatformMobilityService"};
     
        Runtime rt = Runtime.instance();
        ProfileImpl p = new ProfileImpl(false);
     
          System.out.println("test1");
        AgentContainer container =rt.createAgentContainer(p);
        System.out.println("test2");
     
        container.createNewAgent("agent_migration", "migre.agent_migration", args);
        System.out.println("test3");
        AgentController Agent=container.getAgent("agent_migration");
        System.out.println("test4");
        Agent.start();
        System.out.println("test5");
        System.out.println("agent_migration est lancé");
    } catch (Exception any) {
        any.printStackTrace();}                
        %>
    <HTML>
    <BODY>
    It works !!!!
     
     
    </BODY>
    </HTML>
    Et voilà le message d'erreur qui montre qu'il ne peut pas trouver l'agent_migration qui se trouve dans le package migre:
    test0
    12 août 2012 11:16:57 jade.core.Runtime beginContainer
    INFO: ----------------------------------
    This is JADE snapshot - revision $WCREV$ of $WCDATE$
    downloaded in Open Source, under LGPL restrictions,
    at http://jade.tilab.com/
    ----------------------------------------
    test1
    12 août 2012 11:16:57 jade.core.BaseService init
    INFO: Service jade.core.management.AgentManagement initialized
    12 août 2012 11:16:57 jade.core.BaseService init
    INFO: Service jade.core.messaging.Messaging initialized
    12 août 2012 11:16:57 jade.core.BaseService init
    INFO: Service jade.core.mobility.AgentMobility initialized
    12 août 2012 11:16:57 jade.core.BaseService init
    INFO: Service jade.core.event.Notification initialized
    12 août 2012 11:16:57 jade.core.messaging.MessagingService clearCachedSlice
    INFO: Clearing cache
    12 août 2012 11:16:57 jade.core.AgentContainerImpl joinPlatform
    INFO: --------------------------------------
    Agent container Container-3@dell-9e141b5112 is ready.
    --------------------------------------------
    test2
    jade.wrapper.StaleProxyException: Class migre.agent_migration for agent ( agent-identifier :name agent_migration@dell-9e141b5112:1099/JADE ) not found [nested java.lang.ClassNotFoundException: migre.agent_migration]
    at jade.wrapper.ContainerController.createNewAgent(ContainerController.java:124)
    at org.apache.jsp.test3_jsp._jspService(test3_jsp.java:84)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)
    Quelqu'un saurait-il m'indiquer comment résoudre ce problème ?

    Merci d'avance pour votre aide.

  2. #2
    Membre averti
    Homme Profil pro
    Inscrit en
    Octobre 2011
    Messages
    250
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2011
    Messages : 250
    Points : 403
    Points
    403
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    not found [nested java.lang.ClassNotFoundException: migre.agent_migration]
    Ben visiblement il ne trouve pas ta classe "migre.agent_migration", soit elle ne compile pas et ton conteneur ne l'a pas déployée, soit elle n'est pas dans le bon classloader.

  3. #3
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2012
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Juillet 2012
    Messages : 11
    Points : 19
    Points
    19
    Par défaut
    Bonjour pour votre réponse, est ce que vous savez comment faire la migration d'un agent jade a partir d'une page jsp et merci encore une autre fois pour votre réponse

  4. #4
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2012
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Juillet 2012
    Messages : 11
    Points : 19
    Points
    19
    Par défaut
    ah pour info j'ai déja corriger le code au-dessus et normalement il trouve cette classe il me reste le problème de migration d'agent a partir d'une page jsp

  5. #5
    Membre averti
    Homme Profil pro
    Inscrit en
    Octobre 2011
    Messages
    250
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2011
    Messages : 250
    Points : 403
    Points
    403
    Par défaut
    Désolé, je n'ai jamais utilisé Jade.

Discussions similaires

  1. Migration agent Jade à partir d'une page JSP
    Par rouchka2010 dans le forum Programmation par agent
    Réponses: 0
    Dernier message: 18/08/2012, 11h10
  2. Accéder à un agent Jade à partir d'une page JSP
    Par rouchka2010 dans le forum Programmation par agent
    Réponses: 0
    Dernier message: 11/08/2012, 17h32
  3. Acces à l'arborescence d'un disque à partir d'une page jsp
    Par fabricew59 dans le forum Servlets/JSP
    Réponses: 2
    Dernier message: 29/09/2006, 16h53

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo