[BUG] After upgrading to Spring Boot 2.6, Key Vault binder stopped working: NoClassDefFoundError: com.nimbusds.oauth2.sdk.http.CommonContentTypes
See original GitHub issueI upgraded my app:
Spring boot 2.1.6.RELEASE -> Spring Boot 2.6.7 /2.6.6
After that, the app stopped working because of app context failure:
java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/nimbusds/oauth2/sdk/http/CommonContentTypes
at com.microsoft.azure.keyvault.spring.boot.AzureKeyVaultCredential.doAuthenticate(AzureKeyVaultCredential.java:48)
at com.microsoft.azure.keyvault.authentication.KeyVaultCredentials.getAuthenticationCredentials(KeyVaultCredentials.java:113)
at com.microsoft.azure.keyvault.authentication.KeyVaultCredentials.access$100(KeyVaultCredentials.java:27)
at com.microsoft.azure.keyvault.authentication.KeyVaultCredentials$2.authenticate(KeyVaultCredentials.java:81)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.followUpRequest(RetryAndFollowUpInterceptor.java:230)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:119)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at com.microsoft.rest.retry.RetryHandler.intercept(RetryHandler.java:75)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at com.microsoft.rest.interceptors.CustomHeadersInterceptor.intercept(CustomHeadersInterceptor.java:140)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at com.microsoft.rest.interceptors.BaseUrlHandler.intercept(BaseUrlHandler.java:43)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at com.microsoft.rest.interceptors.RequestIdHeaderInterceptor.intercept(RequestIdHeaderInterceptor.java:29)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at com.microsoft.rest.interceptors.UserAgentInterceptor.intercept(UserAgentInterceptor.java:83)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at com.microsoft.azure.keyvault.authentication.KeyVaultCredentials$1.intercept(KeyVaultCredentials.java:59)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
at okhttp3.RealCall.execute(RealCall.java:81)
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:10327)
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:10423)
at rx.Observable.subscribe(Observable.java:10390)
at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:443)
at rx.observables.BlockingObservable.single(BlockingObservable.java:340)
at com.microsoft.azure.keyvault.KeyVaultClientImpl.getSecrets(KeyVaultClientImpl.java:2951)
at com.microsoft.azure.keyvault.KeyVaultClient.listSecrets(KeyVaultClient.java:911)
at com.microsoft.azure.keyvault.spring.boot.KeyVaultOperation.createOrUpdateHashMap(KeyVaultOperation.java:80)
at com.microsoft.azure.keyvault.spring.boot.KeyVaultOperation.<init>(KeyVaultOperation.java:35)
at com.microsoft.azure.keyvault.spring.boot.KeyVaultPropertyInitializer.initialize(KeyVaultPropertyInitializer.java:45)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:648)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:417)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1365)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354)
at com.sams.clubops.receiptcheck.transactionaudit.AuditApplication.main(AuditApplication.java:19)
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
- Bug Description Added
- Repro Steps Added
- Setup information Added
Issue Analytics
- State:
- Created a year ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
[BUG] After upgrading to Spring Boot 2.4, kafka ... - GitHub
[BUG] After upgrading to Spring Boot 2.4, kafka binder stopped working: NoClassDefFoundError: com.nimbusds.oauth2.sdk.http.CommonContentTypes # ...
Read more >com.nimbusds.oauth2.sdk.http.CommonContentTypes Maven ...
CommonContentTypes maven / gradle build tool code. The class is part of the package ➦ Group: com.nimbusds ➦ Artifact: oauth2-oidc-sdk ➦ Version: 4.15....
Read more >cas-server-support-azuread-authentication - Google Groups
I'm presented my custom login page, and when I authenticate, ... NoClassDefFoundError: com/nimbusds/oauth2/sdk/http/CommonContentTypes].>.
Read more >[错误]升级到Spring Boot 2.4后,Kafka Binder停止工作
[BUG] After upgrading to Spring Boot 2.4, kafka binder stopped working: NoClassDefFoundError: com.nimbusds.oauth2.sdk.http.
Read more >com/nimbusds/oauth2/sdk/http/CommonContentTypes ...
Unable to Integrate msal4j api : NoClassDefFoundError: com/nimbusds/oauth2/sdk/http/CommonContentTypes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jayachandravvs, instead of adding the
spring-cloud-azure-autoconfigure
you should add the following instead:And seems like you are running into a dependency conflict, can you share your pom file?
Found the solution for this for the aboveb issue , just had to add this in my test properties
spring.cloud.azure.keyvault.secret.property-source-enabled=false spring.cloud.azure.keyvault.secret.property-sources[0].profile.tenant-id=1 spring.cloud.azure.keyvault.secret.property-sources[0].endpoint=https://azure.com spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-id=1 spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-secret=1
This ticket can be closed , thanks for the help. appreciate it !!