java.lang.NoClassDefFoundError: io/jsonwebtoken/Jwts
See original GitHub issuejava.lang.NoClassDefFoundError: io/jsonwebtoken/Jwts
When I run locally with mvn spring-boot:run
, there’s no problem.
But when I package my application into a fully executable jar with mvn clean install
and then run the jar as a systemd service, I get this error seen above.
It comes from this line:
String user = Jwts.parser()...
Some information: Version of this package that the issue occurs: 0.11.1 Platform: Ubuntu 18.04 Related dependency in maven pom.xml:
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.11.1</version>
</dependency>
Also I checked the generated jar file, the dependency jjwt-impl.0.11.1 is there:
BOOT-INF.lib.jjwt-impl-0.11.1.jar BOOT-INF.lib.jjwt-api-0.11.1.jar BOOT-INF.lib.jjwt-jackson-0.11.1.jar
Don’t know how to solve this. I thought just adding the io.jsonwebtoken to maven dependency would solve all things related to classpath etc…
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
At the moment no, but if I am unable to fix this soon, I’ll create a one.
I tried updating maven package spring-boot-starter-parent which handles packaging to 1.5.2.RELEASE -> 1.5.22.RELEASE, and now Im getting a different error:
java.lang.NoClassDefFoundError: org/apache/tomcat/util/http/parser/AcceptLanguage
Glad to hear you got it working!