i'm not a unix freak, but i have an ubuntu installation up and running on a seperate machine. i started both, client and server gui, on both machines in alternating constellations, and made a few strange observations:
linux server, windows client - InetAddress delivers only "127.0.0.1", but not the real network ip. hostname is correct - remote connection establishes, but after first operation everything else seems to fail. didnt debug yet, no log output...
windows server, linux client - InetAdress delivers correct local network ip & hostname - remote connection works, all operations seem to work fine - BUT: my windows firewall popped up with a conncetion at port 32856. (everything is configurated to 1099, how can that be...?)
i'm using jdk 1.4.2 on windows (that's where i'm developing, too), and 1.5.0 on linux. but i cannot imagine that the jdk version is a problem, 1.5 should be perfectly backward compatible, or?
can anyone confirm similar problems / no problems at all?
For the first problem (Linux server / Windows client), I don't have any concrete ideas - it may be a problem of the registry or the server binding to localhost and not allowing a connection from a different IP address. But in that case I would expect to see an exception somewhere. Another alternative is if a firewall was stopping the connection to your server (not the registry - see the answer to your other question), however Ubuntu does not come with a firewall installed / configured, so unless you have manually set that up it should not be an issue (if you have manually set up a firewall, then running RMI apps through a firewall is beyond the scope of the assignment, but if you want to discuss it, we can).
[windows host / xxx client] my windows firewall popped up with a conncetion at port 32856. (everything is configurated to 1099, how can that be...?)
The rmiregistry is configured to use port 1099 by default, but this is not the port your server is listening on.
When you create a new instance of a UnicastRemoteObject (which your server application probably extends), unless you specify a port to listen on, the UnicastRemoteObject no argument constructor creates and exports a remote object on an anonymous (or arbitrary) port, chosen at runtime (ref). So the moment you created the instance of your server application (before you bind it), it is already listening on some unknown port. The problem then is that a client wont know which port to connect to: this is where binding to the registry comes into play - when you bind to the registry, you are effectively telling the registry "this is what my server app name is, and this is what port I am listening on". When a client does a "lookup" on the registry, the client gets told what port to really connect to.
Clear as mud?
Regards, Andrew [ September 12, 2005: Message edited by: Andrew Monkhouse ]
it's amazing on how many threads you are helping us people with so much valuable information. germany says "thank you". if you ever make it to berlin, the beer is on me ;-)
windows server / linux client: i had no clue about the rmi mechanism you are describing, thanks for clearing that point. that makes extremely sense.
linux server / windows client i'm with you that the root of the problem probably lays somewhere in the setting of the computer. i'll put more debug information into the code and have a look for the exception thrown. and no, i don't have a firewall set up in ubuntu. very strange for a long term windows user to go online without a firewall ;-)
no, i dont want to run the application through a firewall. that's way beyond the scope in my eyes, if the user has a firewall, he has to open port 1099...
thanks again for you answer,
many greetings, jan
author and jackaroo
if you ever make it to berlin, the beer is on me ;-)
I love Berlin - so vibrant and so easy to just get a push-bike and ride everywhere in the city. Potsdam is another favourite (although the process of renting a bike in Potsdam was not so nice).
Pity I can't go over right now. I used to live in Holland for a few years, and I have very fond memories of the Bok Beers that came out about this time of year (probably not so well known in Germany though).
And a 17 hour flight just for a beer is probably a little too decadent .
Hmmm, may have strayed from the focus of this forum a bit .