azure-sdk-for-java: [BUG] SecretClientBuilder : java.lang.NoClassDefFoundError: reactor/netty/tcp/ProxyProvider$TypeSpec
Describe the bug The above issue is when we tried to use azure sdk for keyvaults and instantiate SecretClient using SecretClientBuilder.
Issue in com.azure: azure-security-keyvault-secrets 4.2.x in combination with io.projectreactor.netty:reactor-netty:jar:1.0.3
Exception or Stack Trace
2021-03-18T18:58:53.6444488Z Caused by: java.lang.NoClassDefFoundError: reactor/netty/tcp/ProxyProvider$TypeSpec 2021-03-18T18:58:53.6445215Z at com.azure.core.http.netty.NettyAsyncHttpClientBuilder.lambda$build$7(NettyAsyncHttpClientBuilder.java:142) 2021-03-18T18:58:53.6446059Z at reactor.netty.http.client.HttpClient.tcpConfiguration(HttpClient.java:1465) 2021-03-18T18:58:53.6446779Z at com.azure.core.http.netty.NettyAsyncHttpClientBuilder.build(NettyAsyncHttpClientBuilder.java:122) 2021-03-18T18:58:53.6447555Z at com.azure.core.http.netty.NettyAsyncHttpClientProvider.createInstance(NettyAsyncHttpClientProvider.java:17) 2021-03-18T18:58:53.6448328Z at com.azure.core.implementation.http.HttpClientProviders.createInstance(HttpClientProviders.java:51) 2021-03-18T18:58:53.6449000Z at com.azure.core.http.HttpClient.createDefault(HttpClient.java:50) 2021-03-18T18:58:53.6449617Z at com.azure.core.http.HttpClient.createDefault(HttpClient.java:40) 2021-03-18T18:58:53.6450243Z at com.azure.core.http.HttpPipelineBuilder.build(HttpPipelineBuilder.java:62) 2021-03-18T18:58:53.6450942Z at com.azure.security.keyvault.secrets.SecretClientBuilder.buildAsyncClient(SecretClientBuilder.java:161)
**2021-03-18T18:58:53.6451836Z at com.azure.security.keyvault.secrets.SecretClientBuilder.buildClient(SecretClientBuilder.java:104)
To Reproduce Using below dependencies spring boot version : 2.4.2 in combination with
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-secrets</artifactId>
<version>4.2.x</version>
<exclusions>
</exclusions>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.2.0</version>
</dependency>
and try to build SecretClientBuilder object
Code Snippet
new SecretClientBuilder()
.vaultUrl(keyVaultUri)
.credential(new DefaultAzureCredentialBuilder().build())
.buildClient();
Maven dependency tree:
+- com.azure:azure-security-keyvault-secrets:jar:4.2.0:compile
[INFO] | +- com.azure:azure-core:jar:1.7.0:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.11.4:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.11.4:compile
[INFO] | | | +- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.11.4:compile
[INFO] | | | +- org.codehaus.woodstox:stax2-api:jar:4.2.1:compile
[INFO] | | | \- com.fasterxml.woodstox:woodstox-core:jar:6.2.3:compile
[INFO] | | +- io.projectreactor:reactor-core:jar:3.4.2:compile
[INFO] | | | \- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] | | \- io.netty:netty-tcnative-boringssl-static:jar:2.0.36.Final:compile
[INFO] | \- com.azure:azure-core-http-netty:jar:1.5.4:compile
[INFO] | +- io.netty:netty-handler:jar:4.1.58.Final:compile
[INFO] | | +- io.netty:netty-common:jar:4.1.58.Final:compile
[INFO] | | +- io.netty:netty-resolver:jar:4.1.58.Final:compile
[INFO] | | +- io.netty:netty-transport:jar:4.1.58.Final:compile
[INFO] | | \- io.netty:netty-codec:jar:4.1.58.Final:compile
[INFO] | +- io.netty:netty-handler-proxy:jar:4.1.58.Final:compile
[INFO] | | \- io.netty:netty-codec-socks:jar:4.1.58.Final:compile
[INFO] | +- io.netty:netty-buffer:jar:4.1.58.Final:compile
[INFO] | +- io.netty:netty-codec-http:jar:4.1.58.Final:compile
[INFO] | +- io.netty:netty-codec-http2:jar:4.1.58.Final:compile
[INFO] | +- io.netty:netty-transport-native-unix-common:jar:4.1.58.Final:compile
[INFO] | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.58.Final:compile
[INFO] | +- io.netty:netty-transport-native-kqueue:jar:osx-x86_64:4.1.58.Final:compile
[INFO] | **\- io.projectreactor.netty:reactor-netty:jar:1.0.3:compile**
[INFO] | +- io.projectreactor.netty:reactor-netty-core:jar:1.0.3:compile
[INFO] | | +- io.netty:netty-resolver-dns:jar:4.1.58.Final:compile
[INFO] | | | \- io.netty:netty-codec-dns:jar:4.1.58.Final:compile
[INFO] | | \- io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.58.Final:compile
[INFO] | +- io.projectreactor.netty:reactor-netty-http:jar:1.0.3:compile
[INFO] | \- io.projectreactor.netty:reactor-netty-http-brave:jar:1.0.3:runtime
[INFO] | \- io.zipkin.brave:brave-instrumentation-http:jar:5.13.3:runtime
[INFO] | \- io.zipkin.brave:brave:jar:5.13.3:runtime
[INFO] | \- io.zipkin.reporter2:zipkin-reporter-brave:jar:2.16.3:runtime
[INFO] | \- io.zipkin.reporter2:zipkin-reporter:jar:2.16.3:runtime
[INFO] | \- io.zipkin.zipkin2:zipkin:jar:2.23.2:runtime
```
**Expected behavior**
The SecretClientBuilder has instatiated the SecretClient sucessfully.
**Screenshots**
NA
**Setup (please complete the following information):**
- OS: Windows
- IDE : Intellij
- azure-security-keyvault-secrets 4.2.0
**Additional context**
Add any other context about the problem here.
**Fix for now**
```
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-secrets</artifactId>
<version>4.2.x</version>
<exclusions>
</exclusions>
</dependency>
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty</artifactId>
<version>0.9.12.RELEASE</version>
</dependency>
```
**Information Checklist**
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [x ] Bug Description Added
- [x ] Repro Steps Added
- [x ] Setup information Added
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (8 by maintainers)
For right now,
azure-security-keyvault-secrets+ overridingazure-coreto1.14.1is the way to go until a newer version ofazure-security-keyvault-secretsis released. New versions are generally shipped around the first few weeks of the month, so a new release should happen in early April, this new version will include all code in1.14.1azure-coreplus any additional enhancements added in March.cc: @vcolin7
Hi @Jeevankumar555,
Would you mind closing this issue as the original problem has been resolved and then opening a new one for problem No. 2 in your list? That is, if you are still facing it. Thanks!