• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

RMI and Ubuntu (Linux) Problem!

Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers!

I am getting frustrated with Java RMI running on Linux (I use Ubuntu 9.04). Maybe some of you faced the same problem I do now and found a solution for this, and I will really appreciate your help with this.

I get a RemoteException each time I try to bind a stub with the RMI Registry.

I do rmic the code before executing it and as far as I know I don't need to be worried about setting up a policy file or a SecurityManager for this (I have Andrew's and Terry's SCJD book and I probably read the RMI chapter 1000 times to try to find out a lead to my problem with no luck).

## My /etc/hosts file content:

## My /etc/hosts.allow file content:

## The (trimmed and simplyfied) relevant part of my code follows:

## stub information:

DataServerImpl_Stub[UnicastRef [liveRef: [endpoint:[lobo-laptop:47839](local),objID:[-31110a77:12407db5840:-7fff, -6460063892832792796]]]]

## registry information:

RegistryImpl_Stub[UnicastRef [liveRef: [endpoint:[](remote),objID:[0:0:0, 0]]]]

## Exception information:

It looks weird to me that the Registry implementation was bound to, and also that its ObjID is [0:0:0, 0].
It also seems that hava is not able to create sockets, but Ubuntu's log mechanism has no information about it.

Any ideas on how to solve this (besides using Windows, of course)?
Thanks a lot!

Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi brother!

Be attention. Andrew's book say clearly:

"If you choose not to extend UnicastRemoteObject but rather call the class method UnicastRemoteObject.export in the constructor, then the object methods such as hashcode, toString, and equals must be implemented."

Are you implementing this methods??
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marcelo,

I had exactly the same problem, turns out to be a known issue with linux installations setting the in /etc/hosts. If you remove that line; lobo-laptop

you will probably find it works. Not too familiar with why this is set in a clean ubuntu install, but have made note of it in my javadoc and choices.txt.

you shouldn't need that setProperty either.
Marcelo Ruiz
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks for your comments, but it is not related to the problem I had.


Thanks... Yeah, it is weird that is the default setting in a fresh installation. After researching more is not just a Java RMI-related problem.
Also, I think there is a problem with when Java stops the RMI Registry. I think at least they should add a: "isRunning()" method or something like that to Registry, so one can figure out if a new call to create() is needed instead of getRegistry(). This last one can return a new reference to a registry that is not initialized, and the exception you get does not help much to determine the origin of the problem.

If you're gonna buy things, buy this thing and I get a fat kickback:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic