wood burning stoves*
The moose likes Threads and Synchronization and the fly likes Error in lookup: java.rmi.ConnectException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Error in lookup: java.rmi.ConnectException" Watch "Error in lookup: java.rmi.ConnectException" New topic

Error in lookup: java.rmi.ConnectException

neg yazdi

Joined: Sep 09, 2009
Posts: 1
I got this error when I run my client side program in a project using RMI:

Error in lookup: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect

I do not know what is the problem
if I add " System.setSecurityManager(new RMISecurityManager()); " to the server side I got the following error

Exception in thread "main" java.security.AccessControlException: access denied (java.net.SocketPermission connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at business.ServerMain.main(ServerMain.java:30)

line 30 is:
// put the local instance in the registry
Naming.rebind("SAMPLE-SERVER", Server);

please help me as soon as possible...

I agree. Here's the link: http://aspose.com/file-tools
subject: Error in lookup: java.rmi.ConnectException
Similar Threads
Exception: Connection refused to host
Urgent Help...Connection refused to host
Cannot Start RMI Server
Urgent.... database connection "Connection refused to host:"
JMX Conenctor setting in WAS 6.0