Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invoke methods through The Internet

843793Mar 1 2004 — edited Mar 8 2004
I have an ADSL router, and hub switch before my comuter
Router IP is: 192.168.1.1
My local IP is: 192.168.1.7
I set the vitual server setting of the ADSL router as the following:
MyConnetion switchs to local IP 192.168.1.7 and both of their ports are 1099

I start my RMI server like this

start rmiregistry
start java ServerObj
my server code: Naming.rebind("rmi://192.168.1.7/MMM", XX);
any other local computers (eg: 192.168.1.8, 192.168.1.6) can invoke the rmi methods and work fine
but my friend fails to invoke my RMI methods through the Internet
client file: Jitf XX = (Jitf)Naming.lookup("rmi://"+args[0].trim()+"/MMM");
I gave my friend my IP address eg 203.168.57.203 as Client file's main method's input argument
Then, it just fails

Error Msg
java.rmi.ConnectException: Connection refused to host: 192.168.1.7; nested exception is:
java.net.ConnectException: Connection timed out: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
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:101)
at J701Impl_Stub.returnInt(Unknown Source)
at J701cli.main(J701cli.java:13)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
at java.net.Socket.connect(Socket.java:425)
at java.net.Socket.connect(Socket.java:375)
at java.net.Socket.<init>(Socket.java:290)
at java.net.Socket.<init>(Socket.java:118)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:122)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
... 5 more

Coudl anyone know how to solve this problem, please?

When I used Dail-up 56k connection, my computer owns the IP from ISP.
And I start my RMI servcer directly with the IP from ISP
ie. Naming.rebind("rmi://Whatever IP ISP gives me/MMM", XX);
So all worked fine (both local and Internet invocations)
But not now.............
Could any help me, please?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2004
Added on Mar 1 2004
34 comments
635 views