aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes My RMI server not running properly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "My RMI server not running properly" Watch "My RMI server not running properly" New topic
Author

My RMI server not running properly

K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2419
    
    7

Hi all, I have done my RMI server as follow:


Now when I run it just completes no exceptions. Am I missing something after the rebind line?

K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Ulises Pulido
Ranch Hand

Joined: Jul 24, 2008
Posts: 81
Hello K.Tsang:

I believe you do, after the rebind the method finishes and the server stop running, it may be because the thread just dies.

What I did to solve the problem was to follow an advice from another folk here at JavaRanch who used a GUI to not let the thread die and for the server to keep running.


Hope this helps!


Regards!


SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCJD, SCEA in progress
www.ulisespulido.com
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11460
    
  94

Ulises Pulido wrote:What I did to solve the problem was to follow an advice from another folk here at JavaRanch who used a GUI to not let the thread die and for the server to keep running.

Nope - that's not the problem (in fact most people here have the opposite problem - they find that they can't stop the registry programatically, so they create a GUI so they can force the server to shutdown).

K. Tsang - what is DBRemote - is that your interface? Can you please provide the signature for that interface? Not for the methods within it, just the interface itself.

Likewise, can you please provide the signature for the RemoteData class?


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2419
    
    7

Thanks Andrew for your comments. In fact, I kinda figured it out myself why the RMI doesn't keep running. The fact is in my RemoteData class, which implements DBRemote interface. At first I have the following:



Then I changed the RemoteData class to extend UnicastRemoteObject


and everything works fine now.

But yet I noticed some people that they don't have to extend UnicastRemoteObject and still keep the server running. Is that true?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My RMI server not running properly