1

I need to access azure cloud table using java. My internet works behind proxy and needs authentication. I searched on internet and found this -

System.setProperty("http.proxyHost", "172.16.2.1");
System.setProperty("http.proxyPort", "3128");
System.setProperty("http.proxyUser", "username");
System.setProperty("http.proxyPassword", "password");

but it gives the following error,

The Azure storage client library sample TableBasics starting... Got an exception from running samples. Exception details: com.microsoft.windowsazure.services.core.storage.StorageException: The server encountered an unknown failure: Proxy Authentication Required at com.microsoft.windowsazure.services.core.storage.StorageException.translateException(StorageException.java:129) at com.microsoft.windowsazure.services.core.storage.utils.implementation.StorageOperation.materializeException(StorageOperation.java:158) at com.microsoft.windowsazure.services.core.storage.utils.implementation.ExecutionEngine.executeWithRetry(ExecutionEngine.java:142) at com.microsoft.windowsazure.services.table.client.QueryTableOperation.performRetrieve(QueryTableOperation.java:218) at com.microsoft.windowsazure.services.table.client.TableOperation.execute(TableOperation.java:562) at com.microsoft.windowsazure.services.table.client.CloudTableClient.execute(CloudTableClient.java:262) at com.microsoft.windowsazure.services.table.client.CloudTable.exists(CloudTable.java:416) at com.microsoft.windowsazure.services.table.client.CloudTable.createIfNotExist(CloudTable.java:223) at com.microsoft.windowsazure.services.table.client.CloudTable.createIfNotExist(CloudTable.java:186) at test1.TableBasics.main(TableBasics.java:63)

The Azure storage client library sample TableBasics completed.

Ronn Wilder
  • 1,228
  • 9
  • 13
  • 1
    It looks like your proxy authentication code isn't working. You may need to use java.net.Authenticator as per another stackoverflow thread here - http://stackoverflow.com/questions/1626549/authenticated-http-proxy-with-java. If you suspect that this might be an issue with the Azure SDK, could you share a Fiddler trace of this request to see what is happening on the wire? A short code sample reproducing this error would also be helpful (but please do not share your passwords or secret keys). – Veena Udayabhanu - MSFT Jun 13 '14 at 16:09
  • thanks for this. I am now getting some other errors, but atleast I am now over this proxy authentication problem. – Ronn Wilder Jun 13 '14 at 18:02
  • java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringEscapeUtils at com.microsoft.windowsazure.services.table.client.AtomPubParser.parseEntity(AtomPubParser.java:101) -- please help me with this... I don't know what this error means, and how to resolve this. any suggestions are highly appreciable. – Ronn Wilder Jun 13 '14 at 18:06

1 Answers1

0

Use "https" instead of "http" to proxy user and proxy password of system property

System.setProperty("http.proxyHost", "172.16.2.1");
System.setProperty("http.proxyPort", "3128");
System.setProperty("http.proxyUser", "username");
System.setProperty("http.proxyPassword", "password");

instead of

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");