aspose file tools*
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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Error in lookup: java.rmi.ConnectException" Watch "Error in lookup: java.rmi.ConnectException" New topic
Author

Error in lookup: java.rmi.ConnectException

neg yazdi
Greenhorn

Joined: Sep 09, 2009
Posts: 1
hi
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 127.0.0.1:1099 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
Urgent.... database connection "Connection refused to host:"
Urgent Help...Connection refused to host
JMX Conenctor setting in WAS 6.0
Cannot Start RMI Server
Exception: Connection refused to host