Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

java.lang.NoSuchMethodError: com.nimbusds.jwt.JWTClaimsSet.<init>(Ljava/util/Map;Lcom/nimbusds/jwt/JWTClaimsSet;) #17

@terminatur

Description

@terminatur

I have followed the key-vault-java-certificate-authentication example

I am attempting to authenticate my usage of the keyvault with a certificate and private key.

My code is here:

    val privateKey: PrivateKey =   //...
    val certificate: X509Certificate = //...
    val keyVaultClient = new KeyVaultClient(new KeyVaultCredentials() {
      override def doAuthenticate(authorization: String, resource: String, scope: String): String = {

        try {
          val context = new AuthenticationContext(authorization, false, Executors.newFixedThreadPool(1))
          val asymmetricKeyCredential = AsymmetricKeyCredential.create(appId, privateKey, certificate)
          //pass null value for optional callback function and acquire access token
          val result = context.acquireToken(resource, asymmetricKeyCredential, null).get

          return result.getAccessToken
        } catch {
          case e: Exception =>
            e.printStackTrace()
        }
        ""
      }
    })

When I run this on my windows machine, everything works as expected and I am able to use the client to retrieve keys from the keyvault. However, when I run this on a linux machine, I receive the following error:

java.lang.NoSuchMethodError: com.nimbusds.jwt.JWTClaimsSet.(Ljava/util/Map;Lcom/nimbusds/jwt/JWTClaimsSet;)V
at com.nimbusds.jwt.JWTClaimsSet$Builder.build(JWTClaimsSet.java:306)
at com.microsoft.aad.adal4j.JwtHelper.buildJwt(JwtHelper.java:67)
at com.microsoft.aad.adal4j.AuthenticationContext.acquireToken(AuthenticationContext.java:384)
at com.microsoft.mssales.keyvault.KeyVaultUtility$$anon$1.doAuthenticate(KeyVaultUtility.scala:121)
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.HttpEngine.followUpRequest(HttpEngine.java:946)
at okhttp3.RealCall.getResponse(RealCall.java:279)
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.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 com.microsoft.rest.interceptors.UserAgentInterceptor.intercept(UserAgentInterceptor.java:83)
at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
at com.microsoft.azure.keyvault.authentication.KeyVaultCredentials$1.intercept(KeyVaultCredentials.java:59)
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)
at rx.observables.BlockingObservable.single(BlockingObservable.java:341)
at com.microsoft.azure.keyvault.KeyVaultClientImpl.getSecret(KeyVaultClientImpl.java:2868)
at com.microsoft.azure.keyvault.KeyVaultClient.getSecret(KeyVaultClient.java:838)
at com.microsoft.mssales.keyvault.KeyVaultUtility.getKeyValue(KeyVaultUtility.scala:49)
at com.microsoft.mssales.keyvault.KeyVaultUtility.replaceKeys(KeyVaultUtility.scala:73)
at com.microsoft.mssales.keyvault.KeyVaultUtility$.replaceKeys(KeyVaultUtility.scala:208)
at com.microsoft.mssales.processing.domain.DataSourceUpdatesWithJdbc.initialize(DataSourceUpdatesWithJdbc.scala:39)
at com.microsoft.mssales.processing.domain.DataSourceUpdatesWithJdbc.(DataSourceUpdatesWithJdbc.scala:110)
at com.microsoft.mssales.processing.domain.DataManager.(DataManager.scala:24)
at epa.BaseDriverLogic$class.dataManager(BaseDriverLogic.scala:31)
at com.microsoft.mssales.processing.driver.PipelineDriver.dataManager$lzycompute(PipelineDriver.scala:14)
at com.microsoft.mssales.processing.driver.PipelineDriver.dataManager(PipelineDriver.scala:14)
at epa.BaseDriverLogic$class.sharedData(BaseDriverLogic.scala:32)
at com.microsoft.mssales.processing.driver.PipelineDriver.sharedData$lzycompute(PipelineDriver.scala:14)
at com.microsoft.mssales.processing.driver.PipelineDriver.sharedData(PipelineDriver.scala:14)
at com.microsoft.mssales.processing.driver.PipelineDriver.process(PipelineDriver.scala:56)
at epa.BaseDriverLogic$class.start(BaseDriverLogic.scala:166)
at com.microsoft.mssales.processing.driver.PipelineDriver.start(PipelineDriver.scala:14)
at com.microsoft.mssales.channelreporting.PipelineDriverDroolsTest$.main(PipelineDriverDroolsTest.scala:17)
at com.microsoft.mssales.channelreporting.PipelineDriverDroolsTest.main(PipelineDriverDroolsTest.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$3.run(ApplicationMaster.scala:654)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions