奇葩问题java.io.IOException: Error writing to server 1C

用java swing 做了一个客户端,手动模拟http请求,在个别xp和win10中出现服务器写入错误。
错误信息如下:
java.io.IOException: Error writing to server
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:626)
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:638)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1322)
at com.tysi.common.http.HttpRequester.makeContent(HttpRequester.java:95)
at com.tysi.common.http.HttpRequester.send(HttpRequester.java:88)
at com.tysi.common.http.HttpRequester.sendPost(HttpRequester.java:39)
at com.tysi.client.login.FerryClientLogin.checkLoginUrl(FerryClientLogin.java:530)
at com.tysi.client.login.FerryClientLogin.LoginEvent(FerryClientLogin.java:412)
at com.tysi.client.login.FerryClientLogin$11.mouseClicked(FerryClientLogin.java:372)
at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)
at java.awt.Component.processMouseEvent(Component.java:6519)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6281)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4872)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4501)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:720)
at java.awt.EventQueue$4.run(EventQueue.java:718)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

代码如下:
private HttpRespons makeContent(String urlString,
        HttpURLConnection urlConnection) throws IOException {
    HttpRespons httpResponser = new HttpRespons();
    try {
        InputStream in = urlConnection.getInputStream();
        BufferedReader bufferedReader = new BufferedReader(
                new InputStreamReader(in));
        httpResponser.contentCollection = new Vector();
        StringBuffer temp = new StringBuffer();
        String line = bufferedReader.readLine();
        while (line != null) {
            httpResponser.contentCollection.add(line);
            temp.append(line).append("\r\n");
            line = bufferedReader.readLine();
        }

        在InputStream in = urlConnection.getInputStream();抛出异常

        求各位大神帮忙,实在不知道是什么原因导致的。

2个回答

可以先去更新jdk试试了

caozhy
贵阳老马马善福专业维修游泳池堵漏防水工程 请管理员注意封杀这个胡乱灌水的
3 年多之前 回复

java.io.IOException: Error writing to server
我也遇到了,本地没事

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐