English 中文(简体)
HTTPClient-java.net.SocketException: Unconnected sockets not implemented thrown
原标题:

Iam using HTTPClient 4.0 to connect a remote server and transfer file using HTTPS. When i tried to connect i get the exception "java.net.SocketException: Unconnected sockets not implemented". Please look at the stack trace

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) 

The same error is found while using HTTP Client 3.1.

My Environment Application Server : Websphere application server 6.1.0.23 Java : JDK 1.5.0.16

问题回答

Actually a more complete answer than suppressingfire is

  1. Add com.ibm.ws.admin.client_7.0.0.jar to java build

    This solves the java.lang.NoClassDefFoundError: com.ibm.ffdc.Manager error.

  2. Add to setup:

    import java.security.Security;
    ...
    Security.setProperty("ssl.SocketFactory.provider", "com.ibm.jsse2.SSLSocketFactoryImpl");
    

    This solves the Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory

When I enabled javax.net.debug, I noticed that there was a missing class com.ibm.websphere.com.ibm.websphere.ssl.protocol.SSLSocketFactory.

I was experiencing trouble in unit tests that invoke httpclient. What I ended up doing was to add this line to my TestClass.setUp()

Security.setProperty("ssl.SocketFactory.provider", "com.ibm.jsse2.SSLSocketFactoryImpl");




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签