• Post Reply Bookmark Topic Watch Topic
  • New Topic

ConnectException  RSS feed

 
Jamie Young
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am finding out that RMI is very hard any help would be great!
I need some help handeling the following exception:
java.rmi.ConnectException: Connection refused to host 127.0.0.1, nested exception is: java.net.ConnectException: Connection refused: no further information.
or if I add System.setSecurityManager(new RMISecuritryManager());
java.security.AccessControlException: Access denied
------------------
 
Bala Chandra
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm also looking for a solution to this problem.
Please can any one help.
Thanks in advance
Bala Chandra
 
Panagiotis Varlagas
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all. I am experiencing the exact same problems.
Especially with the ConnectException error (Connection refused), I am getting it when I have two JVMs on the same physical machine. I have a hunch that this has to do with security policies and socket permissions.
Anyone?
Thanks tons,
Panagiotis.
 
Panagiotis Varlagas
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've found the answer to my own question. This may or not be the solution to your problem. ConnectException may occur owing to various reasons; this is just one of them.
Well, my problem was due to the fact that I was prematurely
terminating my RMI server process, because of a misconception I had about the way the whole RMI mechanism works. As a result, there was no server to connect to, because I had killed it unintentionally.
Here is what I thought originally:
"The main thread of my RMI server JVM will be the only non-daemon
thread of that JVM. As soon as it terminates, the JVM will terminate also. My remote requests will be serviced by the RMI registry directly (!). Why not put some System.exit() statements in my server's main() method so that I return an RC to the OS?"
Well, there were two errors in my thoughts above:
1) There is another non-daemon thread in my RMI server JVM, namely RMI Reaper. It is one of a bunch of threads created by the RMI runtime. This thread will prevent the JVM from dying...
2) ... so that it services my remote requests. RMI service no requests itself! It is nothing more than a name server. That's all it's in it.
Actually, this is even a known RMI "non-bug" ; see the Bug Parade, http://developer.java.sun.com/developer/bugParade/bugs/4384670.html
Panagiotis.
[This message has been edited by Panagiotis Varlagas (edited October 29, 2001).]
 
Jamie Young
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved my problem. For one I took out the security manager bussiness since this was just a local school assignment and by inserting a string "local host" for the host during creation. I do not quite specifically know exactly what solved my problem, but I got past this exception. I also changed the way the client contacted the rmi sever. I did A getRegistry() instead of what ever it was I was doing. I have since moved on to something else, but if I find the time I will locate the code segment a send it out to folks still stuck on this exception
------------------
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!