Hello
i am trying this code:
int PORT_SSL = 2019;
Registry registrySSL = LocateRegistry.createRegistry(PORT_SSL, new SslRMIClientSocketFactory(), new SslRMIServerSocketFactory());
HelloImpl objSSL = new HelloImpl(PORT_SSL, new SslRMIClientSocketFactory(), new SslRMIServerSocketFactory());
// not null :
Registry temp = LocateRegistry.getRegistry(PORT_SSL);
// does not work: ???
Naming.rebind("rmi://localhost:" + PORT_SSL + "/" + "HelloServer", objSSL);
// does work !!!
registrySSL.rebind("HelloServer", objSSL);
and get the Exception:
java.rmi.ConnectIOException: non-JRMP server at remote endpoint
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:230)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at ServerStarter.main(ServerStarter.java:37)
but isn't Naming.rebind() supposet to just delegate the call to Registry.rebind() ?
What am i missing ? What is the deal with SSLSocketFactories ?
Help appreciated
Michael