Re: Rmi working only on localhost

Vinod Johnson - Sun Microsystems <[email protected]>
Newsgroups gmane.comp.java.sun.rmi
Message-ID <[email protected]>
Marco Iora wrote:

>I've followed some tutorials i've found on the net, but I can get RMI to
>work only on localhost. I'm using Sun Jdk 1.5.0.01 on two linux-based box.
>
>I report the problems I get running the rmi example from
>http://java.sun.com/j2se/1.5.0/docs/guide/rmi/hello/hello-world.html
>
>I have done mkdir to create coherent directory with packages example.hello
>and put in ~/example/hello the three .java files (Hello.java Server.java
>Client.java.
>Then i make the class files with a "javac example/hello/*.java"
>(I've done things up to here to both the server and the client machines)
>
>Then i start the rmiregistry and launch "java example.hello.Server" on the
>first machine.
>It says: Server ready
>
>When i start "java example.hello.Client 192.168.10.46" (that is the ip of
>the first machine) on the second machine i get these exceptions:
>
>Client exception: java.rmi.ConnectException: Connection refused to host:
>127.0.0.1; nested exception is:
>        java.net.ConnectException: Connection refused
>java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested
>exception is:
>        java.net.ConnectException: Connection refused
>        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
>        at
>
>
Maybe you have some name resolution problem on your server host? What
happens if you run your server with
java  -Djava.rmi.server.hostname=192.168.10.46 example.hello.Server.*||*

--
- vinod

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.