• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about connection string in the rebing Method (RMI)

 
Olena Golub
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone,

Unfortunally I can not test the rmi connection with two computers.
And I have same question about the right RMI connection string.
My current implementation of the server is:

But I have some doubts about the connection string in the rebind method.
Is this correct way to rebing the Remote Object?

Or do I need to use in this way:

For the second case is this correct way to use "localhost" in connectionString?
The person who starts the server has now possibility to enter only two parametes: port and the database location.
Do I need to implement the third paramether : the adress of the server? Or can I use always "localhost"?

Thanks a lot for your help!
Olena
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The person who starts the server has now possibility to enter only two parametes: port and the database location.
Do I need to implement the third paramether : the adress of the server? Or can I use always "localhost"?


Hi Olena,

You do not need to specify the server address when you bind the object. It will be implicitly set.

My code is very similar to your first example:


Frans.
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunally I can not test the rmi connection with two computers.


BTW, I really recommend that you test your application using two computers. You will definitely auto-fail if it happens not to work. If you don't have a local network, you maybe can ask a co-worker or friend to set-up a server or client through the internet?

Frans.
 
Daniel Dalton
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think what you're doing looks ok for the server. The registry runs on the server machine, so localhost should do. Clearly you need to start using the proper server address on the client-side when the client comes to do remote lookups.

By the way, you really, really should try to test on more than one machine. If you haven't got two physical machines, you could always get a 30-day trial of VMWare for the purpose & install a copy of linux say, for arguments sake - you might be surprised how much breaks the first time you try it!

Good Luck!
 
Olena Golub
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Frans,

thanks a lof for your precious advice. I will "make tomorrow some my colleagues nervous" with remote tests
And a lot of thanks for your answer.
Regards,
Olena.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic