我需要使用java访问azure云表。我的互联网工作背后的代理和需要认证。我在网上搜索,发现了这个-
System.setProperty("http.proxyHost", "172.16.2.1");
System.setProperty("http.proxyPort", "3128");
System.setProperty("http.proxyUser", "username");
System.setProperty("http.proxyPassword", "password");
但是它给出了以下错误,
Azure存储客户端库示例TableBasics starting…运行样本时出现异常。异常详细信息:com.microsoft.windowsazure.services.core.storage.StorageException: The server遭遇未知失败:Proxy Authentication Requiredcom.microsoft.windowsazure.services.core.storage.StorageException.translateException (StorageException.java: 129)com.microsoft.windowsazure.services.core.storage.utils.implementation.StorageOperation.materializeException (StorageOperation.java: 158)com.microsoft.windowsazure.services.core.storage.utils.implementation.ExecutionEngine.executeWithRetry (ExecutionEngine.java: 142)com.microsoft.windowsazure.services.table.client.QueryTableOperation.performRetrieve (QueryTableOperation.java: 218)com.microsoft.windowsazure.services.table.client.TableOperation.execute (TableOperation.java: 562)com.microsoft.windowsazure.services.table.client.CloudTableClient.execute (CloudTableClient.java: 262)com.microsoft.windowsazure.services.table.client.CloudTable.exists (CloudTable.java: 416)com.microsoft.windowsazure.services.table.client.CloudTable.createIfNotExist (CloudTable.java: 223)com.microsoft.windowsazure.services.table.client.CloudTable.createIfNotExist (CloudTable.java: 186)test1.TableBasics.main (TableBasics.java: 63)
Azure存储客户端库示例TableBasics已完成
使用"https"代替"http"来代理系统属性的用户和代理密码
System.setProperty("http.proxyHost", "172.16.2.1");
System.setProperty("http.proxyPort", "3128");
System.setProperty("http.proxyUser", "username");
System.setProperty("http.proxyPassword", "password");
代替
System.setProperty("http.proxyHost", "172.16.2.1");
System.setProperty("http.proxyPort", "3128");
System.setProperty("https.proxyUser", "username"); // if domain name applicable then System.setProperty("https.proxyUser", "domain\username");
System.setProperty("https.proxyPassword", "password");