https://kotlinlang.org logo
#ktor
Title
# ktor
t

Tobias Gronbach

03/26/2022, 10:13 AM
Hi, having left my Ktor-Project (Ktor-Version 2.0.0-beta-1) untouched (and it was working just fine) for a while I came back and when I clicked "Run Server" I get the following exception and I have no idea what's going on? Any hint? Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper at com.auth0.jwk.UrlJwkProvider.<init>(UrlJwkProvider.java:80) at com.auth0.jwk.JwkProviderBuilder.build(JwkProviderBuilder.java:148) at de.tellsiggi.auth.config.jwt.JwtConfigKt.configure(JwtConfig.kt:31) at de.tellsiggi.ApplicationKt$module$1$1.invoke(Application.kt:34) at de.tellsiggi.ApplicationKt$module$1$1.invoke(Application.kt:33) at io.ktor.server.auth.jwt.JWTAuthKt.jwt(JWTAuth.kt:333) at io.ktor.server.auth.jwt.JWTAuthKt.jwt$default(JWTAuth.kt:329)
a

Aleksei Tirman [JB]

03/26/2022, 5:24 PM
Could you please try to remove a Gradle cache and clean the build?
👌 1
🔥 1
t

Tobias Gronbach

03/26/2022, 6:40 PM
Aleksei, thank you so much!! That solved it! In case anyone is having same issue I deleted Foler
%USERPROFILE%\.gradle\caches
(on windows) and rebuild my project. Aleksei how did you know it was gradle cache?
a

Aleksei Tirman [JB]

03/26/2022, 6:49 PM
Very often when no class or method found error occurs the problem is in a Gradle cache, especially when a code is left untouched.