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

Java EE Discussion :

Application Web et EJB3 [EJB3]


Sujet :

Java EE

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Inscrit en
    Février 2008
    Messages
    222
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 222
    Par défaut Application Web et EJB3
    Salut,

    Je veux réaliser une application web (applet + EJB3), tout d'abord, je me pose une question : est ce que les EJB3.0 remplacent ou peuvent remplacer les servlets, car je ne voit pas à quoi sert un EJB3 et je ne vois pas la différence entre une servlet et EJB3 donc si vous pouvez me l'expliquer, je veux bien.

    Ensuite, j'ai essayé de dévelloper une application web, pour cela, j'ai créé une applet où il y a un bouton et lorsque je clique sur le bouton je fais appel à une fonction que j'ai définit dans mon EJB qui est sayHello, et j'ai un textArea dans le quel il devrait s'afficher hello World, mais ça ne marche pas.

    Voici le code de mon applet :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    public class fenetre1 extends JApplet{
     
    JTabbedPane jtp = new JTabbedPane();
    public void init(){
       setLayout(new BorderLayout());
     
       b1 = new JButton("ok");
       b1.addActionListener(this);
     
       JTexeArea jta = new JTextArea();
     
       this.add(b1,BorderLayout.SOUTH);
    Voici le code de mon ejb : interface

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    package ejb;
    import javax.ejb.*; 
     
    @Remote 
    public interface SimpleBean {
     	public String sayHello(String name);
    }
    implémentation :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    package ejb;
    import javax.ejb.*; 
     
    @Stateless(name="Example", mappedName="ejb/SimpleBeanJNDI") 
    public class SimpleBeanImpl implements SimpleBean {
        public String sayHello(String name) { 	
            return "Hello World"; 	
        } 
    }
    Voici enfin l'erreur :

    javax.naming.CommunicationException: Cannot connect to ORB [Root exception is org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 208 completed: Maybe]
    at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(Unknown Source)
    at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(Unknown Source)
    at com.sun.jndi.cosnaming.CNCtx.<init>(Unknown Source)
    at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(Unknown Source)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at panneau.boutonDocument.runTest(boutonDocument.java:208)
    at panneau.boutonDocument.actionPerformed(boutonDocument.java:241)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 208 completed: Maybe
    at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectionAbort(Unknown Source)
    at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectionAbort(Unknown Source)
    at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.readBits(Unknown Source)
    at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.handleEvent(Unknown Source)
    at com.sun.corba.se.impl.transport.SelectorImpl.run(Unknown Source)
    Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 211 completed: No
    at com.sun.corba.se.impl.logging.ORBUtilSystemException.ioexceptionWhenReadingConnection(Unknown Source)
    at com.sun.corba.se.impl.logging.ORBUtilSystemException.ioexceptionWhenReadingConnection(Unknown Source)
    at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.readGIOPHeader(Unknown Source)
    at com.sun.corba.se.impl.transport.CorbaContactInfoBase.createMessageMediator(Unknown Source)
    ... 3 more
    Caused by: java.io.IOException: End-of-stream
    at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.readFully(Unknown Source)
    at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.read(Unknown Source)
    ... 5 more


    Dernière précision : mon serveur d'application est GlassFish

    Merci pour vos réponses

  2. #2
    Membre éclairé
    Inscrit en
    Février 2008
    Messages
    222
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 222
    Par défaut
    J'ai résolu ce problème, en fait, je travail maintenant avec le serveur d'application JBoss, et je ne fais pas communiquer directement applet - EJB, mais plutôt applet <-> servelt <-> EJB, et là ça fonctionne mieux.

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Février 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2008
    Messages : 30
    Par défaut
    comment mon ami vous avez fait ça . pouvez vous me donner le code de votre simple application en utilisant Jboss, donc Servlet pour la présentation.

    merci infiniment.


+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Comment faire des etats pour une application web ?
    Par ovh dans le forum Autres outils décisionnels
    Réponses: 6
    Dernier message: 06/07/2021, 03h25
  2. VPN et application web en JBoss et EJB3
    Par jenfi dans le forum Développement Web en Java
    Réponses: 0
    Dernier message: 05/01/2012, 11h48
  3. [installeur] Le couteau suisse des applications web
    Par Tournesol dans le forum Développement Web en Java
    Réponses: 3
    Dernier message: 05/01/2004, 17h19
  4. Debuggage d'une application WEB-TOMCAT
    Par oziller dans le forum JBuilder
    Réponses: 3
    Dernier message: 07/02/2003, 23h10
  5. Réponses: 4
    Dernier message: 04/07/2002, 12h31

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