File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI,can't get connect two computers.

 
Robson Martinz
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am noob in RMI and the material on the Internet is kind of hard to understand because the examples are all on the same computer which is odd, since the main purpose of the RMI is another. I tried to implement the server in a computer, and the client on another computer and follow the codes as below:

What is wrong ?

Computer 1 ->Server:
http://pastebin.com/q5p1PPgp

Computer 2-> Client:
http://pastebin.com/uH3pqBqv

Thanks.
 
Pat Farrell
Rancher
Posts: 4660
5
Linux Mac OS X VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RMI is a poor choice if the two computers are on the general internet. It is rare for systems on the Internet to have the necessary ports open for RMI communications.

You may want to read my thread:
http://www.coderanch.com/t/570237/java/java/Why-there-still-interest-lots

In general, RMI is no longer a good choice for general problems. It was occasionally useful back in the 1990s, but there are simply too many problems to justify using it.

Use something like REST over normal HTTP.
 
Darryl Burke
Bartender
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/advanced-java/60365-rmi-cant-get-connect-two-computers.html
https://forums.oracle.com/forums/thread.jspa?messageID=10372062 (currently down for maintenance)
 
Robson Martinz
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry, I'm trying to solve this problem a long time so I decided to try in other forums as well.
I'll put my source code here and the exception to. I don't know what i'm doing wrong, need solve this for a college work.

Computer 1 Server i put this code:


Computer 2 Client i put this code:


Error message:
RemoteException: java.rmi.ConnectException: Connection refused to host: 127.0.1.1; nested exception is:
java.net.ConnectException: Connection refused

Thank You.
 
Pat Farrell
Rancher
Posts: 4660
5
Linux Mac OS X VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Robson Martinz wrote:Error message:
RemoteException: java.rmi.ConnectException: Connection refused to host: 127.0.1.1; nested exception is:
java.net.ConnectException: Connection refused


Either your RMI service is not running, so it could not make the connection, your your computer's operating system firewall is preventing the connection.
If its the firewall, then you will have to reconfigure the firewall.

The problem of firewall ports used by RMI can not be solved in a commercial or enterprise environment. That is the biggest problem with trying to use RMI, and why the technology is dead, and has been dead all of this century.

 
Robson Martinz
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using in both computers Linux Mint with Javac 1.6.0_20.
What do i have to do to know if RMI service is running?
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic