• Post Reply Bookmark Topic Watch Topic
  • New Topic

rmiclient problem

 
Chris Chua
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to you all. I have a problem in getting the remote object from my rmiclient using http, my rmiserver is on the server side where it binds the object at localhost:2001, now I wanted to get the remote object thru http, my client code to get the remote object is Naming.lookup("//localhost:2001/objectname") well i have read that you have to tell the client where to get the object by providing a property like java.rmi.server.codebase=http://localhost:8000/ assuming 8000 is the port where my httpserver is listening I have used that in executing my rmiclient but still it reports connect failure, could somebody help me with this thru some simple code on how i could get the remote object thru http? and what other files if any should be on the client side aside from the interface and rmiclient classes.
Thanks
Chris
 
Fredrik Safstrom
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chris,
Since you are trying to lookup "localhost" (Naming.lookup("//localhost:2001/objectname")) you will not lookup the server, but rather the client. Try replacing localhost with the name of your server or the servers IP address...
Also, I would try adding doublequotes to your codebase, java.rmi.server.codebase="http://localhost:8000/".
You should not have to, but I don't think it hurt to try...
/Bamse
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!