Classpath / JAR issue: OctetSequenceKey.Builder throwing java.lang.NoSuchMethodError
_ 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)
-
-
Classpath is fine.
mvn clean changed nothing.
-
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 :)
-
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>
-
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 :)
-
Unfortunately, removing JOSE jwt and common from the POM had no effect.
-
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
. -
- changed title to Classpath / JAR issue: OctetSequenceKey.Builder throwing java.lang.NoSuchMethodError
-
- changed status to wontfix
No response from reporter, closing for now.
- Log in to comment
Could you check your classpath? And if you're using maven to build your project, run
before compiling or packaging.