Re: Rmi working only on localhost
tony yau <[email protected]>
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <000701c518c2$4db81980$bc01a8c0@ws6> |
this is more of a connection and access problem, make sure:
1) no blocking from firewalls on either machines.
2) the two machine can talk (is rmi port (1036? I can't remember!) open)
tony
----- Original Message -----
From: "Marco Iora" <[email protected]>
To: <[email protected]>
Sent: Tuesday, February 22, 2005 12:24 AM
Subject: Rmi working only on localhost
> 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
> sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
> at
sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
> at
>
java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjec
tInvocationHandler.java:179)
> at
>
java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationH
andler.java:132)
> at $Proxy0.sayHello(Unknown Source)
> at example.hello.Client.main(Client.java:53)
> Caused by: java.net.ConnectException: Connection refused
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
> at java.net.Socket.connect(Socket.java:507)
> at java.net.Socket.connect(Socket.java:457)
> at java.net.Socket.<init>(Socket.java:365)
> at java.net.Socket.<init>(Socket.java:178)
> at
>
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketF
actory.java:22)
> at
>
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketF
actory.java:128)
> at
sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
> ... 7 more
>
> Please help me to solve this problem!!!
> Thank you all.
>
>
===========================================================================
> 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
===========================================================================
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