Method io.jsonwebtoken.Jwts.parserBuilder() not found after migrating to 0.11.2
ckmoga opened this issue · comments
Charles commented
I have just migrated to the latest version and started getting this error at runtime:
java.lang.NoSuchMethodError: io.jsonwebtoken.Jwts.parserBuilder()
My dependencies:
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
implementation group: 'com.kastkode', name: 'springsandwich', version: '1.0.2'
implementation('org.springframework.boot:spring-boot-starter-tomcat')
implementation('org.codehaus.groovy:groovy-all:3.0.7')
implementation "io.jsonwebtoken:jjwt-api:0.11.2"
runtimeOnly "io.jsonwebtoken:jjwt-jackson:0.11.2",
"io.jsonwebtoken:jjwt-impl:0.11.2",
"org.bouncycastle:bcprov-jdk15on:1.68"
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
Les Hazlewood commented
What version did you use previously? Were you able to come to a resolution?
Charles commented
I was on 0.10.2 but my issue was related to the fact that the dependency was runtimeOnly. My project is an SSO library that consumers import and utiliize for authentication. After adding the same dependencies to consumers the issue was resolved.
Les Hazlewood commented
Thanks for the clarification!
Indrajeet Yadav commented
use only Jwts.parser()
this works for me
SohamBagde commented
use only
Jwts.parser()
this works for me
this worked!