HttpURLConnection: java.lang.IllegalStateException: Already connected

前端 未结 3 852
隐瞒了意图╮
隐瞒了意图╮ 2021-02-20 09:17

I\'m trying to use HttpURLClient to send some POST data to a server using the HttpRestClient class shown below. When executing

conn.setDoInput(true)         


        
3条回答
  •  悲&欢浪女
    2021-02-20 09:30

    It may be a misleading exception. See this defect for Jersey-2 https://java.net/jira/browse/JERSEY-2729

    The link has been updated: https://github.com/jersey/jersey/issues/3001

    Basically the issue is jersey was throwing invalid exception. The real issue in my case was that the connection was refused from the server.

提交回复
热议问题