简体   繁体   中英

java.net.SocketException: Software caused connection abort: recv failed with Java 8

I have Client application built on java swing, it throws "java.net.SocketException: Software caused connection abort: recv failed" error when trying to make call to server application. When my client application runs on JRE 8 it throws this error, however when it run of Java 7, i do not see this issue. error is throw at line. InputStreamReader is = new InputStreamReader(conn.getInputStream(), "UTF8");

My server code is running on java 6 on Jboss server.

Below is my client code.

HttpURLConnection conn = (HttpURLConnection) teamupUrl.openConnection();
        conn.setRequestMethod("POST");
        conn.setRequestProperty("Content-Type", "text/xml; charset=\"utf-8\"");
        conn.setDoOutput(true);
        conn.setDoInput(true);
        conn.connect();
        OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "UTF8");
        out.write(xmlMsg);
        out.close();        
        // MDH - changed to use a temporary file to hold the transaction response, to avoid
        // out of memory errors with large files
        InputStreamReader is = new InputStreamReader(conn.getInputStream(), "UTF8");// error is throw here.

I checked few answers but could not able to resolve this issue.

I'm having a similar problem. My URL is using https with the javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword system properties set. Is your URL https? If so maybe it has something to do with the changes in java 8 security. Here's an article about differences between the versions: http://www.oracle.com/technetwork/java/javase/documentation/cve-2014-3566-2342133.html . Let us know if you figure this out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM