azure-sdk-for-java: [BUG] After upgrading to Spring Boot 2.4, kafka binder stopped working: NoClassDefFoundError: com.nimbusds.oauth2.sdk.http.CommonContentTypes
Copied from https://github.com/microsoft/spring-cloud-azure/issues/763. @vprudnikov
Describe the bug
I upgraded my app:
Spring boot 2.3 -> Spring Boot 2.4 spring-cloud-starter-azure-eventhubs-kafka:1.2.7 -> azure-spring-cloud-starter-eventhubs-kafka:2.0.0-beta.1 After that, the app stopped working because of app context failure:
Caused by: java.lang.NoClassDefFoundError: com.nimbusds.oauth2.sdk.http.CommonContentTypes
at com.microsoft.aad.adal4j.AdalTokenRequest.toOAuthRequest(AdalTokenRequest.java:158) ~[adal4j-1.6.4.jar:1.6.4]
at com.microsoft.aad.adal4j.AdalTokenRequest.executeOAuthRequestAndProcessResponse(AdalTokenRequest.java:86) ~[adal4j-1.6.4.jar:1.6.4]
at com.microsoft.aad.adal4j.AuthenticationContext.acquireTokenCommon(AuthenticationContext.java:930) ~[adal4j-1.6.4.jar:1.6.4]
at com.microsoft.aad.adal4j.AcquireTokenCallable.execute(AcquireTokenCallable.java:70) ~[adal4j-1.6.4.jar:1.6.4]
at com.microsoft.aad.adal4j.AcquireTokenCallable.execute(AcquireTokenCallable.java:38) ~[adal4j-1.6.4.jar:1.6.4]
at com.microsoft.aad.adal4j.AdalCallable.call(AdalCallable.java:47) ~[adal4j-1.6.4.jar:1.6.4]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:851) ~[na:na]
Caused by: java.lang.ClassNotFoundException: com.nimbusds.oauth2.sdk.http.CommonContentTypes
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:788) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1081) ~[na:na]
... 10 common frames omitted
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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (10 by maintainers)
@saragluna Thanks for looking into the question. I updated the dependencies and it worked fine with minimal changes.
@vprudnikov sorry for the late response.
Yes, I did reproduce the issue and the solution is to add this to your pom file: