Cannot Resolve method

Issue #315 resolved
Joseph Kinyanjui created an issue

Hello, this might be a quick fix for you people but I cannot find the problem.

I'm using this dependency as follows:

<dependency>
  <groupId>com.nimbusds</groupId>
  <artifactId>oauth2-oidc-sdk</artifactId>
  <version>5.62</version>
  <scope>compile</scope>
</dependency>

I have an error that came out of nowhere to be hones because my app has not been modified in a while. I keep getting this exception:

java.lang.nosuchmethoderror com.nimbusds.jwt.jwtclaimsset.tojsonobject()lnet/minidev/json/jsonobject

I have seen that in the dependency: nimbusds-jose-jwt9.0.1.jar, the JWTClaimsSet class does indeed have the toJSONObject() method.

Does anyone know what could be wrong here?

Kind Regards

Comments (2)

  1. Yavor Vasilev

    Hi Joseph,

    There are two solutions:

    Lock down the Nimbus JWT lib dep in your project to the latest compatible with the SDK:

    <dependency>
                <groupId>com.nimbusds</groupId>
                <artifactId>nimbus-jose-jwt</artifactId>
                <version>8.20.1</version>
            </dependency>
    

    Or switch to a recent v8.x version of the SDK where the build is tied to a specific version of the JWT lib.

  2. Log in to comment