ResourceManager Java SDK列出订阅的问题

时间:2017-09-14 21:11:14

标签: azure azure-management-api azure-java-sdk

我正在尝试使用mgmt-resource SDK -ver 1.2.1列出订阅。我有一些问题,我在下面粘贴。我在代理后面并使用代理创建了ResourceManager.Authenticated对象。然后使用该对象我能够执行auth.subscriptions没有问题。我在控制台上看到auth是成功的,代码返回一些指示验证成功的guid。但是当我执行subs.list时,我得到了异常。我也试过了listAsync。但同样的问题。 (由于格式化,我无法在此处粘贴所有代码)。例外是“试图隧道连接太多:21”我找不到任何解决方案。有什么想法我错过了什么或出了什么问题?我很感激任何工作。感谢...

Subscriptions subs = auth.subscriptions();
List<Subscription> subsList =subs.list();

异常消息:

[pool-1-thread-1] INFO com.microsoft.aad.adal4j.AuthenticationAuthority - [Correlation ID: 099b5a45-5f2c-470a-914e-cd19c16ee0bc] Instance discovery was successful
java.lang.RuntimeException: java.net.ProtocolException: Too many tunnel connections attempted: 21
    at rx.exceptions.Exceptions.propagate(Exceptions.java:58)
    at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:464)
    at rx.observables.BlockingObservable.single(BlockingObservable.java:341)
    at com.microsoft.azure.management.resources.implementation.SubscriptionsInner.list(SubscriptionsInner.java:244)
    at com.microsoft.azure.management.resources.implementation.SubscriptionsImpl.list(SubscriptionsImpl.java:38)
    at AzureLogin.test2(AzureLogin.java:76)
    at AzureLogin.main(AzureLogin.java:24)
Caused by: java.net.ProtocolException: Too many tunnel connections attempted: 21
    at okhttp3.internal.io.RealConnection.buildTunneledConnection(RealConnection.java:148)
    at okhttp3.internal.io.RealConnection.connect(RealConnection.java:108)
    at okhttp3.internal.http.StreamAllocation.findConnection(StreamAllocation.java:187)
    at okhttp3.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:123)
    at okhttp3.internal.http.StreamAllocation.newStream(StreamAllocation.java:93)
    at okhttp3.internal.http.HttpEngine.connect(HttpEngine.java:296)
    at okhttp3.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
    at okhttp3.RealCall.getResponse(RealCall.java:243)
    at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:201)
    at com.microsoft.rest.retry.RetryHandler.intercept(RetryHandler.java:75)
    at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
    at com.microsoft.rest.interceptors.CustomHeadersInterceptor.intercept(CustomHeadersInterceptor.java:140)
    at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
    at com.microsoft.rest.interceptors.UserAgentInterceptor.intercept(UserAgentInterceptor.java:83)
    at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
    at com.microsoft.azure.credentials.AzureTokenCredentialsInterceptor.intercept(AzureTokenCredentialsInterceptor.java:40)
    at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
    at com.microsoft.azure.management.resources.fluentcore.utils.ResourceManagerThrottlingInterceptor.intercept(ResourceManagerThrottlingInterceptor.java:43)
    at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
    at com.microsoft.azure.management.resources.fluentcore.utils.ProviderRegistrationInterceptor.intercept(ProviderRegistrationInterceptor.java:43)
    at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
    at com.microsoft.rest.interceptors.BaseUrlHandler.intercept(BaseUrlHandler.java:43)
    at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
    at com.microsoft.rest.interceptors.RequestIdHeaderInterceptor.intercept(RequestIdHeaderInterceptor.java:29)
    at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163)
    at okhttp3.RealCall.execute(RealCall.java:57)
    at retrofit2.OkHttpCall.execute(OkHttpCall.java:174)
    at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:171)
    at rx.Subscriber.setProducer(Subscriber.java:211)
    at rx.internal.operators.OnSubscribeMap$MapSubscriber.setProducer(OnSubscribeMap.java:102)
    at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
    at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
    at rx.Observable.unsafeSubscribe(Observable.java:10142)
    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at rx.Observable.subscribe(Observable.java:10238)
    at rx.Observable.subscribe(Observable.java:10205)
    at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:444)
    ... 5 more

0 个答案:

没有答案