代理背后的Azure Blob存储SDK V10 / V11快速入门错误

时间:2019-06-14 09:51:10

标签: java proxy azure-storage-blobs

我从github下载并运行了提供的quickstat。它可以在正常网络上正常工作,但如果在代理后面,则可以提供NPE。

WARNING: An exception was thrown by com.microsoft.rest.v2.http.NettyClient$AcquisitionListener.operationComplete()
java.lang.NullPointerException
        at com.microsoft.rest.v2.http.NettyClient$AcquisitionListener.emitError(NettyClient.java:426)

当我更新到v11(11.0.1)时,出现了一个新错误,而不是NPE,但根本不起作用。

WARN  NettyClient - Error emitted before channel is created. Message: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server

我在Google上进行了大量搜索,并尝试在操作环境中设置默认代理,但没有成功。

OperationContext.setDefaultProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyIP, proxyPort)));

您能给我一个更新的(更正后的)快速入门,它可以在代理之后工作吗?还是给我一些线索,如何设置,在哪里设置?

1 个答案:

答案 0 :(得分:0)

据我所知,根据Oracle文档Java Networking and Proxies,访问代理外部的简单方法是通过Java中的http[s].proxyHost设置http[s].proxyPortSystem.setProperty JVM上的所有程序都在代理后面工作。对于其他SO线程Get Image from Azure Blob using Proxy In Java,使用较旧的Azure存储SDK可以解决我的问题。

相关问题