File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes connection refused to host: localhost; Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Reply Bookmark "connection refused to host: localhost; " Watch "connection refused to host: localhost; " New topic
Author

connection refused to host: localhost;

Sylvia Wang
Ranch Hand

Joined: Apr 10, 2001
Posts: 53
Hi,
I'm trying RMI in Jbuilder4, have following codes for server part. and created a policy file to grant all permessions.
but the following exception occured when I tried to run the server:
connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: no further information
how to solve it ? pls help. Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
try {
HelloImpl obj = new HelloImpl();
Naming.rebind("//localhost/HelloServer", obj);
System.out.println("HelloServer bound in registry");
} catch (Exception e) {
System.out.println("HelloImpl err: " + e.getMessage());
e.printStackTrace();
}
Tide Zhang
Greenhorn

Joined: May 27, 2001
Posts: 3
I think you must write the server code like this:
Naming.rebind("HelloServer", obj);
Sylvia Wang
Ranch Hand

Joined: Apr 10, 2001
Posts: 53
Naming.rebind("//localhost/HelloServer", obj);
you can see from my codes.
Tide Zhang
Greenhorn

Joined: May 27, 2001
Posts: 3
Can you show your client code to me!
 
 
subject: connection refused to host: localhost;
 
Threads others viewed
Any difference??
Implementin Unreferenced
RMI app behind VMWare NAT
RMI access denied client/server
RMI Exception
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture