• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

no-JRMP server at remote endpoint Error

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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





 
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A snippet from.. http://java.sun.com/j2se/1.4.2/docs/guide/rmi/getstart.doc.html


Naming.rebind("//myhost/HelloServer", obj);

Note the following about the arguments to the rebind method call:

* The first parameter is a URL-formatted java.lang.String, representing the location and name of the remote object.

1) No protocol needs to be specified in the URL-formatted string.
2) You will need to change the value of myhost to be the name or IP address of your server machine; otherwise, the remote object host defaults to the current host. For example, "HelloServer" is a valid name string that refers to a remote object bound to the name HelloServer, running on the local host.
3) Optionally, a port number can be supplied in the URL-formatted string. Specifying the port number is necessary when the registry that needs to be contacted is running on a port other than the default port, 1099. For example, "//myhost:1234/HelloServer" is a valid name string for the HelloServer remote object, reachable through an RMI registry that is running on the host myhost and is listening for incoming calls on port 1234.
 
michael modenese
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Chinna

thank you for your reply.
I've tried your suggestions. Unfortunately with no success. Still got the
java.rmi.ConnectIOException: non-JRMP server at remote endpoint

May i point out that the same code, but WITHOUT SSL-Factories ist working fine (even with "rmi://"):

int PORT_BARE = 2029;
Registry registry = LocateRegistry.createRegistry(PORT_BARE);
HelloImpl objBARE = new HelloImpl(PORT_BARE);
// works fine:
Naming.rebind("rmi://localhost:" + PORT_BARE + "/" + "HelloServer", objBARE);
// registry.rebind("HelloServer", objBARE);

So i recon the point must be somehow in the SSLSocketFactories. But i cant figure out what the type of the SocketFactories has to do with the binding mechanism.

Any idea ?

Thanks

Michael



 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, has this been solved in the end, or did you give up?

I have a similar issue, where the non-ssl code works fine, yet the other code does not.
 
Thanks tiny ad, for helping me escape the terrible comfort of this chair.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic