• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI server stops

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I understand an RMI server should keep on running indefinately after it has started. In my code however, the application exits after a short time. Anyone has a clue on why this happens?

The following is a snippet from my code:

RemoteContractorAPI server =
ContractorAPIFactory.getContractorAPI(path);

RemoteContractorAPI stub =
(RemoteContractorAPI) UnicastRemoteObject.exportObject(server, 0);

Registry registry = LocateRegistry.createRegistry(port);
registry.rebind(REMOTE_CONTRACTOR_API, stub);

RemoteContractorAPI is an interface which extends my business logic interface and the Remote interface.
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric,
Is your main thread ending ?
 
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Maybe this can help:
RMI Timeout

Regards,
Alex
 
Eric Hendriks
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes it's the main thread (and subsequently all other threads) that's ending. I thought the server would keep on running.
[ October 28, 2008: Message edited by: Eric Hendriks ]
 
Liviu Carausu
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Yes it's the main thread (and subsequently all other threads) that's ending. I thought the server would keep on running.


You should keep at least one not daemon thread alive. I did this by showing a server configuration window The AWT thread keeps the application alive. The RMI threads are all daemons and therefore will be finished when there is no not daemon thread alive.
Greetings,
Liviu
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic