==================
CLIENT SIDE
==================
try
{
srvIntrface = (MyServerInterface) Naming.lookup("rmi://"+server+":1099/Interface");
}catch(Exception e){System.out.println("clientForm, lookup: Error getting the remote service");}
byte[] fileData = srvIntrface.getFile();
---------------------------------------------------------------------------------------------------------
This is how i connect to the interface on the client side... AND then get the file
server variable - is the ip of the remote machine
---------------------------------------------------------------------------------------------------------
==================
SERVER SIDE
==================
MyServer mySrvr = new MyServer();
Naming.rebind("//localhost:1099/Interface",mySrvr);
-------------------------------------------------------------------------------
this is how i bind the interface to the server
------------------------------------------------------------------------------
================
PROBLEM
================
i am working on a LAN.... when i run the above codes on one of the machines e.g. machine1.... the machine1 works fine and can get the file from machine 2. but when i run it on machine 2 and try to get the file from machine 1 following exception occurs
"
Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused: connect
"
Please help
CLIENT SIDE
==================
try
{
srvIntrface = (MyServerInterface) Naming.lookup("rmi://"+server+":1099/Interface");
}catch(Exception e){System.out.println("clientForm, lookup: Error getting the remote service");}
byte[] fileData = srvIntrface.getFile();
---------------------------------------------------------------------------------------------------------
This is how i connect to the interface on the client side... AND then get the file
server variable - is the ip of the remote machine
---------------------------------------------------------------------------------------------------------
==================
SERVER SIDE
==================
MyServer mySrvr = new MyServer();
Naming.rebind("//localhost:1099/Interface",mySrvr);
-------------------------------------------------------------------------------
this is how i bind the interface to the server
------------------------------------------------------------------------------
================
PROBLEM
================
i am working on a LAN.... when i run the above codes on one of the machines e.g. machine1.... the machine1 works fine and can get the file from machine 2. but when i run it on machine 2 and try to get the file from machine 1 following exception occurs
"
Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused: connect
"
Please help