Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in lookup: java.rmi.ConnectException

neg yazdi
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: 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" access denied ( connect,resolve)
at Source)
at Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at Source)
at Source)
at<init>(Unknown Source)
at<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(

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

please help me as soon as possible...

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic