[RMI sur SSL] Un rebind() qui "plante"
Salut à tous,
Je suis en train de coder une application client/serveur en RMI sur une couche SSL. Je suis en java 1.4.2.
Voici mon code de base :
Code:
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
| public class Hello extends UnicastRemoteObject implements HelloInterface
{
public Hello(RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException
{
//super();
super(1099, csf, ssf);
System.out.println("Initialisation de Hello OK.");
}
public int sayHello()
{
try {
System.out.println("Hello, World !");
return 0;
}
catch (Exception e)
{
e.printStackTrace();
return 1;
}
}
public static void main(String[] args)
{
try
{
RMIClientSocketFactory csf = new RMISSLClientSocketFactory();
RMIServerSocketFactory ssf = new RMISSLServerSocketFactory();
HelloInterface myHello = new Hello(csf, ssf);
Registry reg = LocateRegistry.getRegistry("lat203", 1099, csf);
System.out.println("L'objet SERA publie.");
reg.rebind("HelloInterface", myHello); // Ligne 56.
System.out.println("L'objet est publie.");
}
catch (RemoteException e)
{
e.printStackTrace();
}
catch (Exception e)
{
e.printStackTrace();
}
}
} |
J'ai réutilisé les RMISSLServerSocketFactory et RMISSLClientSocketFactory proposés ici.
La version sans SSL fonctionne... Mais lorsque j'essaie de lancer cette application-ci (en debug par exemple), le programme se met en running à la ligne 56 de cette classe hello. Voici la pile au moment où je ne peux plus rien faire :
Citation:
Thread [main] (Stepping)
UnicastRef2(UnicastRef).newCall(RemoteObject, Operation[], int, long) line: 313
RegistryImpl_Stub.rebind(String, Remote) line: not available
Hello.main(String[]) line: 56
Thread [Thread-1] (Running)
Pas moyen de terminer le thread et laisser le thread-1 en vie, ce qui est à mon sens le fonctionnement normal.
Des idées ?
Merci d'avance.