代理返回" HTTP / 1.1 502代理错误(ISA服务器拒绝指定的统一资源定位符(URL)。)"

时间:2015-09-09 07:38:40

标签: java proxy http-proxy alm

我正在尝试运行一个jar并低于异常。

java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 502 Proxy Error ( The ISA Server denied the specified Uniform Resource Locator (URL).  )"
    at sun.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
    at org.econ.alm.core.ALMConnector.doHttp(ALMConnector.java:182)

代码段:

InetSocketAddress sd = new InetSocketAddress("XXX.XXX.X.XXX",80);
Proxy proxy = new Proxy(Proxy.Type.HTTP,sd);
HttpURLConnection con =
(HttpURLConnection) new URL(url).openConnection(proxy);


con.setRequestMethod(type);
String cookieString = getCookieString();

prepareHttpRequest(con, headers, data, cookieString); //User defined function to set content type for con object

con.connect(); //Statement which is generating error

出现此类错误的原因是什么?

0 个答案:

没有答案