Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

RMI server stops

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Hi Eric,
Is your main thread ending ?
 
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
I need a new interior decorator. This tiny ad just painted every room in my house purple.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic