Bonsoir,

J'ai une application client/serveur dont la partie serveur est hébergé et
exécuté par un conteneur Ejb, celui du serveur Glassfish
. Le déploiement de l'application serveur se passe bien.Le client quant à lui présente des erreurs à l'éxécution.
Le client est distant : il utilise une couche [metier] qui s'exécute dans une autre Jvm
.


La classe [Main] de l'application cliente se présente ainsi:

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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package ui.console;
 
import exception.PamException;
import java.util.ArrayList;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import metier.*;
 
public class MainRemote {
       /**
    * @param args
    */
  public static void main(String[] args) {
     // données locales
     final String syntaxe = "pg num_securite_sociale nb_heures_travaillées nb_jours_travaillés";
     // on vérifie le nombre de paramètres
 
     // liste des erreurs
     ArrayList erreurs = new ArrayList();
     // le second paramètre doit être un nombre réel >0
 
     // erreur ?
     if (Double.parseDouble(args[1])<0) {
       erreurs.add("Le nombre d'heures travaillées [" + args[1]
         + "] est erroné");
     }
     // le troisième paramètre doit être un nombre entier >0
 
     // erreur ?
     if (Integer.parseInt(args[2])<0) {
       erreurs.add("Le nombre de jours travaillés [" + args[2]
         + "] est erroné");
     }
     // des erreurs ?
     if (erreurs.size() != 0) {
       for (int i = 0; i < erreurs.size(); i++) {
         System.err.println(erreurs.get(i));
       }
       return;
     }
 
     // c'est bon - on peut demander la feuille de salaire à la couche [métier]
     IMetierRemote metier = null;
 
     FeuilleSalaire feuilleSalaire = null;
     try
     {
           //contexte JNDI du serveur Glassfish
          InitialContext initialContext = new InitialContext();
          // instanciation couche métier
          metier = (IMetierRemote) initialContext.lookup("java:global/pam-serveur-metier-dao-jpa-eclipselink/Metier!metier.IMetierRemote");
 
 
          // calcul de la feuille de salaire
          feuilleSalaire = metier.calculerFeuilleSalaire(args[0], Double.parseDouble(args[1]), Integer.parseInt(args[2]) ) ;
     }
     catch (PamException ex) {
       System.err.println("L'erreur suivante s'est produite : "+ ex.getMessage());
       return;
     } catch (Exception ex) {
       System.err.println("L'erreur suivante s'est produite : "+ ex.toString());
       return;
     }
     ...
   }
 
 
}
L'application coté serveur se nomme «* pam-serveur-metier-dao-jpa-eclipselink*»
et [metier] est un package contenant une interface locale et une interface distante (j'utilise l'interface distante)

Lorsque j'éxécute l'application cliente j'ai l'erreur suivante :

run:
12 avr. 2012 07:29:14 com.sun.enterprise.transaction.JavaEETransactionManagerSimplified initDelegates
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:3431)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:3452)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:256)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:269)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:125)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:188)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:186)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:352)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
at com.sun.enterprise.naming.impl.SerialContext.narrowProvider(SerialContext.java:355)
at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:327)
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:271)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:430)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at ui.console.MainRemote.main(MainRemote.java:61)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
at org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:340)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:239)
... 13 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:106)
at org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:325)
... 14 more
L'erreur suivante s'est produite : javax.naming.NamingException: Lookup failed for 'java:global/pam-serveur-metier-dao-jpa-eclipselink/Metier!metier.IMetierRemote' in SerialContext ,orb'sInitialHost=localhost,orb'sInitialPort=3700 [Root exception is javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext ,orb'sInitialHost=localhost,orb'sInitialPort=3700 [Root exception is org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No]]
BUILD SUCCESSFUL (total time: 1 minute 13 seconds)
Quelqu'un peut -il m'aider?

Merci.