• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI question

 
Adrian Popescu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I have Bodgitt&Scarper application and I've decided to use RMI.
My question is: is there a way to get an object from a remote JVM
without starting rmiregistry? Because in the specifications it isn't mentioned this. Only java -jar runme.jar server.
 
Adrian Popescu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I forgot about the "NX:" prefix
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrian,

is there a way to get an object from a remote JVM
without starting rmiregistry

Nope.


Because in the specifications it isn't mentioned this. Only java -jar runme.jar server

Your program must itself start the rmiregistry:


Best,
Vlad
[ November 04, 2003: Message edited by: Vlad Rabkin ]
 
Adrian Popescu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vlad,
Thanks for your reply.
I'll have to use createRegistry with a RMIClientSocketFactory and a RMIServerSocketFactory, because the other method only creates a registry entry for the specified port on localhost.
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrian,
the other method only creates a registry entry for the specified port on localhost

I don't see any problem with it?
Localhost means your local server. It is still a remote server for other PCs.

Best,
Vlad
 
Adrian Popescu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vlad,
I was thinking to create something like a remote server.
Like, running the application from my computer, and, providing
an ip and a port, to start a server on another machine.
It's quite impossibile in java, so, I'll assume that the
server configuration will only need a port, not an ip.
Regards,
Adrian
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Adrian,
Like, running the application from my computer, and, providing
an ip and a port, to start a server on another machine.
It's quite impossibile in java...

Well, it has nothing to do with java. To start a server remotely you normally connect yourself to this host (e.g. telnet).
Your idea is nice, but I don't see any need to do it. Try to do everything as easy as possible. All what Sun wants is make sure you know how networing is working.
There are other more important things to take care of. I would put my efforts to solve them, rather than trying to develop something like "remote clusters". I have a very small inner class, which starts the rmi registry locally and binds an object to the registry. If something goes wrong, the programm quits, showing the problem message.
Best,
Vlad
[ November 04, 2003: Message edited by: Vlad Rabkin ]
[ November 05, 2003: Message edited by: Vlad Rabkin ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Adrian,
You should also be aware that the Sun reference implementation of the RMI Registry does not allow your server application to reside on a different computer than the RMI Registry. (The specifications allow for it, however the reference implementation doesnt).
And it is the Sun JDK with it's reference implementation that we must use for this assignment.
Regards, Andrew
 
Adrian Popescu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrew,
Thanks for your advice.
I'll try to keep things simple
Regards,
Adrian
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic