Connection refused to host: localhost
up vote
0
down vote
favorite
java.rmi.ConnectException: Connection refused to host: localhost;
nested exception is:
java.net.ConnectException: Connection refused: connect
Server code:
TaxService taxService = new TaxService();
Registry registry = LocateRegistry.createRegistry(8889);
registry.bind("TaxService", taxService);
System.out.println("The server started");
Client code:
Registry registry = null;
try {
registry = LocateRegistry.getRegistry("localhost", 8889);
} catch (RemoteException e1) {
e1.printStackTrace();
}
ITaxService taxService = null;
try {
taxService = (ITaxService) registry.lookup("TaxService");
} catch (RemoteException e) {
System.out.println(e);
}
java rmi connection-refused
add a comment |
up vote
0
down vote
favorite
java.rmi.ConnectException: Connection refused to host: localhost;
nested exception is:
java.net.ConnectException: Connection refused: connect
Server code:
TaxService taxService = new TaxService();
Registry registry = LocateRegistry.createRegistry(8889);
registry.bind("TaxService", taxService);
System.out.println("The server started");
Client code:
Registry registry = null;
try {
registry = LocateRegistry.getRegistry("localhost", 8889);
} catch (RemoteException e1) {
e1.printStackTrace();
}
ITaxService taxService = null;
try {
taxService = (ITaxService) registry.lookup("TaxService");
} catch (RemoteException e) {
System.out.println(e);
}
java rmi connection-refused
Did you run the RMI registry?
– Henry
Nov 10 at 18:26
Henry, Firstly I executed the server side and it worked and after that when I tried to executed the client side I got this error message. The error came from this line registry = LocateRegistry.getRegistry("localhost", 8889);
– Luiza
Nov 10 at 20:49
(1) Are you installing the RMISecurityManager? If yes, you may need to tweak the securlty policy to allow connections to localhost:8889 ... (2) After you start the server, assuming it stays up and running, can you open a second terminal and telnet to localhost 8889 ? If yes, the server is there, so it's a client issue; if no, then it's a server issue ...
– moilejter
Nov 11 at 23:36
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
java.rmi.ConnectException: Connection refused to host: localhost;
nested exception is:
java.net.ConnectException: Connection refused: connect
Server code:
TaxService taxService = new TaxService();
Registry registry = LocateRegistry.createRegistry(8889);
registry.bind("TaxService", taxService);
System.out.println("The server started");
Client code:
Registry registry = null;
try {
registry = LocateRegistry.getRegistry("localhost", 8889);
} catch (RemoteException e1) {
e1.printStackTrace();
}
ITaxService taxService = null;
try {
taxService = (ITaxService) registry.lookup("TaxService");
} catch (RemoteException e) {
System.out.println(e);
}
java rmi connection-refused
java.rmi.ConnectException: Connection refused to host: localhost;
nested exception is:
java.net.ConnectException: Connection refused: connect
Server code:
TaxService taxService = new TaxService();
Registry registry = LocateRegistry.createRegistry(8889);
registry.bind("TaxService", taxService);
System.out.println("The server started");
Client code:
Registry registry = null;
try {
registry = LocateRegistry.getRegistry("localhost", 8889);
} catch (RemoteException e1) {
e1.printStackTrace();
}
ITaxService taxService = null;
try {
taxService = (ITaxService) registry.lookup("TaxService");
} catch (RemoteException e) {
System.out.println(e);
}
java rmi connection-refused
java rmi connection-refused
edited Nov 10 at 17:49
Laurenz Albe
41.4k92746
41.4k92746
asked Nov 10 at 17:34
Luiza
42
42
Did you run the RMI registry?
– Henry
Nov 10 at 18:26
Henry, Firstly I executed the server side and it worked and after that when I tried to executed the client side I got this error message. The error came from this line registry = LocateRegistry.getRegistry("localhost", 8889);
– Luiza
Nov 10 at 20:49
(1) Are you installing the RMISecurityManager? If yes, you may need to tweak the securlty policy to allow connections to localhost:8889 ... (2) After you start the server, assuming it stays up and running, can you open a second terminal and telnet to localhost 8889 ? If yes, the server is there, so it's a client issue; if no, then it's a server issue ...
– moilejter
Nov 11 at 23:36
add a comment |
Did you run the RMI registry?
– Henry
Nov 10 at 18:26
Henry, Firstly I executed the server side and it worked and after that when I tried to executed the client side I got this error message. The error came from this line registry = LocateRegistry.getRegistry("localhost", 8889);
– Luiza
Nov 10 at 20:49
(1) Are you installing the RMISecurityManager? If yes, you may need to tweak the securlty policy to allow connections to localhost:8889 ... (2) After you start the server, assuming it stays up and running, can you open a second terminal and telnet to localhost 8889 ? If yes, the server is there, so it's a client issue; if no, then it's a server issue ...
– moilejter
Nov 11 at 23:36
Did you run the RMI registry?
– Henry
Nov 10 at 18:26
Did you run the RMI registry?
– Henry
Nov 10 at 18:26
Henry, Firstly I executed the server side and it worked and after that when I tried to executed the client side I got this error message. The error came from this line registry = LocateRegistry.getRegistry("localhost", 8889);
– Luiza
Nov 10 at 20:49
Henry, Firstly I executed the server side and it worked and after that when I tried to executed the client side I got this error message. The error came from this line registry = LocateRegistry.getRegistry("localhost", 8889);
– Luiza
Nov 10 at 20:49
(1) Are you installing the RMISecurityManager? If yes, you may need to tweak the securlty policy to allow connections to localhost:8889 ... (2) After you start the server, assuming it stays up and running, can you open a second terminal and telnet to localhost 8889 ? If yes, the server is there, so it's a client issue; if no, then it's a server issue ...
– moilejter
Nov 11 at 23:36
(1) Are you installing the RMISecurityManager? If yes, you may need to tweak the securlty policy to allow connections to localhost:8889 ... (2) After you start the server, assuming it stays up and running, can you open a second terminal and telnet to localhost 8889 ? If yes, the server is there, so it's a client issue; if no, then it's a server issue ...
– moilejter
Nov 11 at 23:36
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
draft saved
draft discarded
draft saved
draft discarded
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241634%2fconnection-refused-to-host-localhost%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you run the RMI registry?
– Henry
Nov 10 at 18:26
Henry, Firstly I executed the server side and it worked and after that when I tried to executed the client side I got this error message. The error came from this line registry = LocateRegistry.getRegistry("localhost", 8889);
– Luiza
Nov 10 at 20:49
(1) Are you installing the RMISecurityManager? If yes, you may need to tweak the securlty policy to allow connections to localhost:8889 ... (2) After you start the server, assuming it stays up and running, can you open a second terminal and telnet to localhost 8889 ? If yes, the server is there, so it's a client issue; if no, then it's a server issue ...
– moilejter
Nov 11 at 23:36