0 Replies Latest reply: May 16, 2012 10:25 PM by 937887 RSS

    httpurlconnection exception: invalid http response (jre 7u4)

    937887
      Im connecting to a private server using httpurlconnection, but however it when i invoke .getInputStream() method after connect to server, it will catches IOexception and returned:

      java.io.IOException: Invalid Http response
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
           at java.lang.reflect.Constructor.newInstance(Unknown Source)
           at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
           at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
           at java.security.AccessController.doPrivileged(Native Method)
           at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
           at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
           at com.ebc.socket.SocketConnMgr.send(SocketConnMgr.java:879)
           at com.ebc.socket.SocketConnMgr.sendSocketRequest(SocketConnMgr.java:1711)
           at com.ebc.socket.SocketConnMgr.sendSocketRequest(SocketConnMgr.java:1638)
           at com.ebc.socket.SocketConnMgr.login(SocketConnMgr.java:1477)
           at com.ebc.socket.SocketConnMgr.checkScConn(SocketConnMgr.java:1388)
           at com.ebc.socket.SocketConnMgr.checkScConn(SocketConnMgr.java:1364)
           at com.ebc.socket.SocketConnMgr.startSoc(SocketConnMgr.java:617)
           at RealTimeMgr.run(RealTimeMgr.java:122)
           at java.lang.Thread.run(Unknown Source)
      Caused by: java.io.IOException: Invalid Http response
           at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
           at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
           at com.ebc.socket.SocketConnMgr.send(SocketConnMgr.java:871)
           ... 8 more

      when im using jre6 it has no this kind of problem but when i update to jre 7u4 it came out exception like this.
      i have try to get response code by invoke .getResponseCode() and it returned -1.
      I want to ask whether there is any solution for this as everytime i invoke getInputStream() it surely catch the same exception and i could'nt continue on it.
      Any help is much appreciated.