我正在尝试运行一个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
出现此类错误的原因是什么?