This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes RMI client server don't work on ipv6 machines Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI client server don Watch "RMI client server don New topic
Author

RMI client server don't work on ipv6 machines

Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
I am unable to use the RMI client server program on ipv6 machines.
1. When I run both client and server on the same machine(IPv6) the code works fine but it prints 127.0.0.1 as the clients ip address
2. When I run server on one machine(IPv6, works) and then i run client on another machine(IPv6) i get the following error

C:\j2sdk1.4.2_08\bin>java -classpath "C:\ClientServer" RmiClient 1234:0000:0000:
0000:0000:0000:0000:5679 3232 XXX
sending XXX to 1234:0000:0000:0000:0000:0000:0000:5679:3232
java.rmi.ConnectIOException: Exception creating connection to: 1234:0000:0000:00
00:0000:0000:0000:5679; nested exception is:
java.net.SocketException: Protocol family not supported
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:580)
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.newCall(UnicastRef.java:313)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at RmiClient.main(RmiClient.java:22)
Caused by: java.net.SocketException: Protocol family not supported
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.<init>(Socket.java:309)
at java.net.Socket.<init>(Socket.java:124)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
SocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
SocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
... 5 more








Thanks & Regards
Mustafa I. Dasorwala

Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
I used jdk 1.6 and got the following errors

C:\ClientServer>java -classpath "C:\ClientServer" RmiClient 1234::5679 3232 QWE
RTY
sending QWERTY to 1234::5679:3232
java.rmi.ConnectException: Connection refused to host: 1234::5679; nested except
ion is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at RmiClient.main(RmiClient.java:22)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
ource)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
ource)
... 6 more
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Check your firewall. That exception you're getting means that your code attempts to connect but that connection is rejected. Main causes are the port not being active, and the port being blocked by a firewall.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
The test environment is at my work place. I'll check the status of the firewall, on Tuesday, when i go to the office. Thanks for the reply.
Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
Filrewall is off on both the machines.
Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
Firewalls on both the machines are disabled.................
Port 3232 is in listening mode as per netstat -an....................
Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
The code works perfectly fine when both the client and the server are running on IPV4 machines.................
Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
Both the ipv6 machines have XP service pack3 installed on it. They are vmware virtual machines.
Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
The code failed on XP (IPv6) and Win2k3(IPv6). But it worked perfectly fine on Win2k8(IPv6)..... When the server was on W2k8 proper details of the client was displayed. I ran the client on both W2k3 and W2k8 and server on W2k8.
Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
The question boils down to: Why does the code not work on Win 2003?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
Are you sure that IPV6 has been installed on your 2003 machine?

Bill
Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
I am successfully able to ping my 2003 machine's ipv6 address via my 2008 machine......................................
Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
I must also mention that the ipconfig command doesn't give any output on my 2003 machine. I just get a string saying "Windows IP configuration is" followed by nothing...................
Mustafa Dasorwala
Greenhorn

Joined: Sep 01, 2011
Posts: 29
I have noticed that rmiregistry crashes (without warning/error), before server completely starts, on win 2003.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI client server don't work on ipv6 machines
 
Similar Threads
RMI pass by value or by reference ?
can't solve the problem on RMI client code
RMI Example
Access Control Exception
Help needed in RMI