Iam使用HTTPClient 4.0連接遠程服務器並使用HTTPS傳輸文件。 當我試圖連接時,我得到異常「java.net.SocketException:未連接的套接字未實現」。 請看堆棧跟蹤HTTPClient-java.net.SocketException:未實現未連接套接字
java.net.SocketException: Unconnected sockets not implemented
at java.lang.Throwable.<init>(Throwable.java:196)
at java.lang.Exception.<init>(Exception.java:41)
at java.io.IOException.<init>(IOException.java:40)
at java.net.SocketException.<init>(SocketException.java:29)
at javax.net.SocketFactory.createSocket(SocketFactory.java:2)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(Unknown Source)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(Unknown Source)
at org.apache.commons.httpclient.HttpConnection.open(Unknown Source)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown Source)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown Source)
at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
at co.com.personalsoft.ftpseguro.utilidades.TransmisionHTTP.ejecutarTransmisionHTTP(TransmisionHTTP.java:107)
at co.com.personalsoft.ftpseguro.utilidades.TransmisionFTPNew.ejecutarTransmisionAuto(TransmisionFTPNew.java:483)
at co.com.personalsoft.ftpseguro.utilidades.TransmisionFTPNew.ejecutarTransmision(TransmisionFTPNew.java:1016)
at co.com.personalsoft.ftpautomatico.ConexionThread.run(ConexionThread.java:58)
at java.lang.Thread.run(Thread.java:595)
同樣的錯誤,同時使用HTTP客戶端3.1中。
我的環境 應用服務器:在WebSphere Application Server 6.1.0.23 的Java:JDK 1.5.0.16
是否在外面工作的WebSphere?也許websphere取代了套接字工廠? – bmargulies 2009-11-15 22:39:31
這是在websphere應用程序服務器5.1中工作的 錯誤僅在WAS 6.1中發現 – 2009-11-16 20:30:16
我在RAD 7.0和WAS 6.1測試環境下看到此錯誤。使用最新的JDK啓動它時,同樣的確切代碼有效,但是WAS 6.1測試環境中使用的任何版本都會失敗。它似乎與特定的JDK版本有關:http://old.nabble.com/Unconnected-sockets-not-implemented-td19107059.html和http://stackoverflow.com/questions/116635/socketexception-unconnected-sockets - 未實現 - 用自簽署的SSL-CERTI – Suppressingfire 2009-12-08 16:48:26