CloudFoundryOperations初始化错误

时间:2018-04-17 03:30:56

标签: spring spring-cloud cloudfoundry pivotal-cloud-foundry

我正在尝试使用org.cloudfoundry.operations.CloudFoundryOperation列出pcf环境中可用服务的实例。我在笔记本电脑上安装了cf命令行客户端,可以执行大多数所有'cf'命令。

当我尝试使用CloudFoundryOperations列出我的组织中的服务和云代工厂的空间时,我正在跟踪堆栈跟踪。似乎应用程序无法@Autowired CloudFoundryOperations。 调试反应堆代码很困难。但是,我的问题似乎是使用适当的属性初始化CloudfoundryOperations。

示例代码位于https://github.com/jaysara/pcf-client

<pre>
Suppressed: reactor.core.publisher.FluxOnAssembly$AssemblySnapshotException: null
        at reactor.core.publisher.MonoOnAssembly.<init>(MonoOnAssembly.java:62) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
        at reactor.core.publisher.Mono.checkpoint(Mono.java:1367) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
        at reactor.core.publisher.Mono.checkpoint(Mono.java:1317) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
        at org.cloudfoundry.reactor.tokenprovider.AbstractUaaTokenProvider.token(AbstractUaaTokenProvider.java:271) ~[cloudfoundry-client-reactor-3.3.0.RELEASE.jar:3.3.0.RELEASE]
        at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_131]
        at org.cloudfoundry.reactor.tokenprovider.AbstractUaaTokenProvider.getToken(AbstractUaaTokenProvider.java:107) ~[cloudfoundry-client-reactor-3.3.0.RELEASE.jar:3.3.0.RELEASE]
        at org.cloudfoundry.reactor.util.AbstractReactorOperations.addAuthorization(AbstractReactorOperations.java:258) ~[cloudfoundry-client-reactor-3.3.0.RELEASE.jar:3.3.0.RELEASE]
        at reactor.core.publisher.Mono.transform(Mono.java:3553) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
        at org.cloudfoundry.reactor.util.AbstractReactorOperations.lambda$null$4(AbstractReactorOperations.java:103) ~[cloudfoundry-client-reactor-3.3.0.RELEASE.jar:3.3.0.RELEASE]
        at reactor.ipc.netty.http.client.HttpClient.lambda$handler$4(HttpClient.java:429) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
        at reactor.ipc.netty.http.client.MonoHttpClientResponse$HttpClientHandler.apply(MonoHttpClientResponse.java:119) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
        at reactor.ipc.netty.http.client.MonoHttpClientResponse$HttpClientHandler.apply(MonoHttpClientResponse.java:82) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
        at reactor.ipc.netty.channel.ChannelOperations.applyHandler(ChannelOperations.java:380) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
        at reactor.ipc.netty.http.client.HttpClientOperations.onHandlerStart(HttpClientOperations.java:501) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[netty-common-4.1.23.Final.jar:4.1.23.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[netty-common-4.1.23.Final.jar:4.1.23.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[netty-transport-4.1.23.Final.jar:4.1.23.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) [netty-common-4.1.23.Final.jar:4.1.23.Final]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
    Suppressed: reactor.core.publisher.FluxOnAssembly$AssemblySnapshotException: null
        at reactor.core.publisher.MonoOnAssembly.<init>(MonoOnAssembly.java:62) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
        at reactor.core.publisher.Mono.checkpoint(Mono.java:1367) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
        at reactor.core.publisher.Mono.checkpoint(Mono.java:1317) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
        at org.cloudfoundry.reactor.tokenprovider.AbstractUaaTokenProvider.token(AbstractUaaTokenProvider.java:271) ~[cloudfoundry-client-reactor-3.3.0.RELEASE.jar:3.3.0.RELEASE]
        at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_131]
        at org.cloudfoundry.reactor.tokenprovider.AbstractUaaTokenProvider.getToken(AbstractUaaTokenProvider.java:107) ~[cloudfoundry-client-reactor-3.3.0.RELEASE.jar:3.3.0.RELEASE]
        at org.cloudfoundry.reactor.util.AbstractReactorOperations.addAuthorization(AbstractReactorOperations.java:258) ~[cloudfoundry-client-reactor-3.3.0.RELEASE.jar:3.3.0.RELEASE]
        at reactor.core.publisher.Mono.transform(Mono.java:3553) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
        at org.cloudfoundry.reactor.util.AbstractReactorOperations.lambda$null$4(AbstractReactorOperations.java:103) ~[cloudfoundry-client-reactor-3.3.0.RELEASE.jar:3.3.0.RELEASE]
        at reactor.ipc.netty.http.client.HttpClient.lambda$handler$4(HttpClient.java:429) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
        at reactor.ipc.netty.http.client.MonoHttpClientResponse$HttpClientHandler.apply(MonoHttpClientResponse.java:119) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
        at reactor.ipc.netty.http.client.MonoHttpClientResponse$HttpClientHandler.apply(MonoHttpClientResponse.java:82) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
        at reactor.ipc.netty.channel.ChannelOperations.applyHandler(ChannelOperations.java:380) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
        at reactor.ipc.netty.http.client.HttpClientOperations.onHandlerStart(HttpClientOperations.java:501) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[netty-common-4.1.23.Final.jar:4.1.23.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[netty-common-4.1.23.Final.jar:4.1.23.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[netty-transport-4.1.23.Final.jar:4.1.23.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) [netty-common-4.1.23.Final.jar:4.1.23.Final]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
</pre>

gradle文件依赖性配置如下。

<pre>
ext {
    springCloudVersion = 'Finchley.M9'
}
dependencies {
    compile('org.springframework.boot:spring-boot-starter-webflux')
    compile('org.springframework.cloud:spring-cloud-starter-config')
    compile('org.springframework.cloud:spring-cloud-cloudfoundry-commons')
    compile('org.springframework.cloud:spring-cloud-cloudfoundry-discovery')
    compile 'org.springframework.cloud:spring-cloud-cloudfoundry-dependencies:2.0.0.M3'
    compileOnly('org.projectlombok:lombok')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    testCompile('io.projectreactor:reactor-test')
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
        mavenBom "org.springframework.cloud:spring-cloud-cloudfoundry-dependencies:2.0.0.M3"
    }
</pre>

0 个答案:

没有答案