繁体   English   中英

java.net.SocketException:软件导致连接中止:Java 8 recv失败

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

我有基于Java swing构建的客户端应用程序,尝试调用服务器应用程序时会引发“ java.net.SocketException:软件导致连接中止:recv失败”错误。 当我的客户端应用程序在JRE 8上运行时,会引发此错误,但是在Java 7上运行时,我看不到此问题。 错误被抛出行。 InputStreamReader是= new InputStreamReader(conn.getInputStream(),“ UTF8”);

我的服务器代码在Jboss服务器上的Java 6上运行。

以下是我的客户代码。

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.

我检查了几个答案,但无法解决此问题。

我有类似的问题。 我的URL使用https和javax.net.ssl.trustStore和javax.net.ssl.trustStorePassword系统属性设置。 您的网址是https吗? 如果是这样,也许与Java 8安全性的变化有关。 以下是有关版本之间差异的文章: http : //www.oracle.com/technetwork/java/javase/documentation/cve-2014-3566-2342133.html 让我们知道您是否能解决这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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