Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

My RMI server not running properly

 
Bartender
Posts: 3648
16
Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
author and jackaroo
Posts: 12199
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
K. Tsang
Bartender
Posts: 3648
16
Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic