连接java RMI Server 报java.net.SocketException: Protocol family unavailable错误
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.ConnectIOException: Exception creating connection to: 2001:0:4137:9e76:2876:2747:3f57:f393; nested exception is:
java.net.SocketException: Protocol family unavailable
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
我在widnow7+jdk1.5的环境,连接RMI Server居然报错。从错误信息connection to: 2001:0:4137:9e76:2876:2747:3f57:f393,得知用的是ipv6.
我ping 这个地址能成功,可为什么报错呢,曾经看过文章说jdk14对ipv6支持的并不是很好,虽然已经实现了Inet6Address,但jdk15可以支持.
莫非是jdk版本的问题,我将jdk换成1.6,果然OK.
以前用的是XP+ jdk1.5是没有问题的,莫非window 7 需要jdk1.6? 问题是解决了,但是为什么还是不清楚。