Classpath / JAR issue: OctetSequenceKey.Builder throwing java.lang.NoSuchMethodError

Issue #190 wontfix
Former user created an issue

_ 2016-06-16 16:13:32,100 [RMI TCP Connection(2)-127.0.0.1] ERROR org.springframework.web.context.ContextLoader - Caused by: java.lang.NoSuchMethodError: com.nimbusds.jose.jwk.OctetSequenceKey$Builder.<init>([B)V 2016-06-16 16:13:32,100 [RMI TCP Connection(2)-127.0.0.1] ERROR org.springframework.web.context.ContextLoader - at com.nimbusds.jose.jwk.source.ImmutableSecret.<init>(ImmutableSecret.java:30) __ 2016-06-16 16:13:32,100 [RMI TCP Connection(2)-127.0.0.1] ERROR org.springframework.web.context.ContextLoader - at com.nimbusds.openid.connect.sdk.validators.IDTokenValidator.<init>(IDTokenValidator.java:190)

Comments (9)

  1. Connect2id OSS

    Could you check your classpath? And if you're using maven to build your project, run

    mvn clean
    

    before compiling or packaging.

  2. Connect2id OSS

    Could you be having an instance of JAR hell?

    java.lang.NoSuchMethodError may occur if two instances of the lib have been loaded for some reason, possibly with different versions.

    Could you check that?

    Also, which version do you have - of the JOSE lib and the OIDC SDK lib?

    Any additional context about what gets loaded here and version could be of help here :)

  3. Glump

    Here's what I got in the POM:

            <dependency>
                <groupId>com.nimbusds</groupId>
                <artifactId>nimbus-jose-jwt</artifactId>
                <version>4.19</version>
            </dependency>
            <dependency>
                <groupId>com.nimbusds</groupId>
                <artifactId>oauth2-oidc-sdk</artifactId>
                <version>5.10</version>
            </dependency>
            <dependency>
                <groupId>com.nimbusds</groupId>
                <artifactId>common</artifactId>
                <version>1.102</version>
            </dependency>
    
  4. Connect2id OSS

    Leave just the OIDC SDK dependency and let it automatically pick its own transitive deps. (including the jose /jwt dep)

    The "common" dep shouldn't really be there, unless you know what you are doing :)

  5. Connect2id OSS

    This is beginning to resemble a real Jar hell now :))

    If you're building a JAR or WAR, could you post its content here, e.g. with zipinfo -1.

  6. Log in to comment