Note that there are some explanatory texts on larger screens.

plurals
  1. PORESTeasy HTTP proxy - SOCKS error
    primarykey
    data
    text
    <p>I'm experiencing issues Java's useSystemProxy-Feature in combination with RESTeasy's ClientRequest class:</p> <pre><code>ClientRequest request = new ClientRequest(Config.getInstance().getProperty(Config.UPDATE_URL)); ClientResponse&lt;FullscreenUpdateTransfer&gt; response = request.get(FullscreenUpdateTransfer.class); if (response.getStatus() != Response.Status.OK.getStatusCode()) { throw new Exception("HTTP Status Response: " + response.getStatus()); } </code></pre> <p>Throws after about a minute:</p> <pre><code>java.net.SocketException: Malformed reply from SOCKS server at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:90) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429) at java.net.Socket.connect(Socket.java:529) at java.net.Socket.connect(Socket.java:478) at java.net.Socket.&lt;init&gt;(Socket.java:375) at java.net.Socket.&lt;init&gt;(Socket.java:249) at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:79) at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:121) at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324) at org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor.execute(ApacheHttpClientExecutor.java:64) at org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:39) at org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor.execute(AcceptEncodingGZIPInterceptor.java:40) at org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:45) at org.jboss.resteasy.client.ClientRequest.execute(ClientRequest.java:448) at org.jboss.resteasy.client.ClientRequest.httpMethod(ClientRequest.java:655) at org.jboss.resteasy.client.ClientRequest.get(ClientRequest.java:483) at org.jboss.resteasy.client.ClientRequest.get(ClientRequest.java:503) at de.taf.easygo.modules.dfimanager.database.logic.Update.run(Update.java:110) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) </code></pre> <p>So Apache HTTP Client seems to be told to use a SOCKS proxy by RESTeasy. (Now that I re-read the stack trace it rather seems Socket is ordered to use a SOCKS proxy by Apache HTTP Client.) Have been searching for a solution for a while now. I worked around it many times by using HttpUrlConnection and then manually give the result to a JaxbContext. Not very convenient, especially if it comes to PUT requests, so I'd like to ask if anybody solved this.</p> <p>Of cause I'm using a tested/working HTTP proxy for this.</p> <p>I DO NOT have the option to provide the proxy via proxyHost/proxyPort properties. I need to use java.net.useSystemProxies.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload