• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI server stops

 
Eric Hendriks
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.
 
Liviu Carausu
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,
Is your main thread ending ?
 
Alex Belisle Turcot
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic