I’ve developed a Java server on Win XP and it works great, using the java.nio package.
However - When I put it to the test and ran it from my Linux (Mandrake / RedHat) server where it’s suppose to run, the server just ignore my client. Nothing happens!
The client gets the follow exception:
java.net.ConnectException: Connection refused: connect
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:457)
I tried to use tutorial examples from sun’s homepage (TimeQuery / TimeServer) and I get the same error : Works great on windows but not at all in Linux.
However, it works when I reverse the roles and let Linux be client and use Windows as Server.
Therefore I make the conclusion that Linux has to be modified in some way (security aspects?) so that it is allowed to listen, connect, accept new connections…
It obviousely works when Linux acts as a client, but not at all as server!
I tried to modify my java.policy file but I can’t make it work!
Thanx for your help!
/Markus