• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI,can't get connect two computers.

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
https://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.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic