question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.NoClassDefFoundError when using jwt-circe with http4s

See original GitHub issue

I’m running into the below exception when trying to use jwt-circe v3.1.0 with http4s v0.20.10. This appears be due to the libraries depending on different versions of Circe 0.12.0-M3 vs. 0.11.1. The code works if I downgrade to jwt-circev3.0 which uses the same Circe version as http4s.

Is there a specific reason for using the 0.12 milestone build? Could Circe version be downgraded to the latest release version?

java.lang.NoClassDefFoundError: io/circe/jawn/CirceSupportParser$
	at org.http4s.circe.CirceInstances.$anonfun$jsonDecoderAdaptive$1(CirceInstances.scala:60)
	at org.http4s.EntityDecoder$$anon$7.decode(EntityDecoder.scala:176)
	at org.http4s.EntityDecoder$$anon$2.decode(EntityDecoder.scala:43)
	at org.http4s.client.DefaultClient.$anonfun$expectOr$2(DefaultClient.scala:99)
	at cats.effect.Resource.$anonfun$use$1(Resource.scala:120)
	at cats.effect.internals.IOBracket$BracketStart.liftedTree1$1(IOBracket.scala:79)
	at cats.effect.internals.IOBracket$BracketStart.run(IOBracket.scala:79)
	at cats.effect.internals.Trampoline.cats$effect$internals$Trampoline$$immediateLoop(Trampoline.scala:70)
	at cats.effect.internals.Trampoline.startLoop(Trampoline.scala:36)
	at cats.effect.internals.TrampolineEC$JVMTrampoline.super$startLoop(TrampolineEC.scala:93)
	at cats.effect.internals.TrampolineEC$JVMTrampoline.$anonfun$startLoop$1(TrampolineEC.scala:93)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85)
	at cats.effect.internals.TrampolineEC$JVMTrampoline.startLoop(TrampolineEC.scala:93)
	at cats.effect.internals.Trampoline.execute(Trampoline.scala:43)
	at cats.effect.internals.TrampolineEC.execute(TrampolineEC.scala:44)
	at cats.effect.internals.Callback$AsyncIdempotentCallback.apply(Callback.scala:133)
	at cats.effect.internals.Callback$AsyncIdempotentCallback.apply(Callback.scala:120)
	at org.http4s.client.blaze.Http1Connection.parsePrelude(Http1Connection.scala:296)
	at org.http4s.client.blaze.Http1Connection.$anonfun$readAndParsePrelude$1(Http1Connection.scala:189)
	at org.http4s.client.blaze.Http1Connection.$anonfun$readAndParsePrelude$1$adapted(Http1Connection.scala:188)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: java.lang.ClassNotFoundException: io.circe.jawn.CirceSupportParser$
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 28 more

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
marko-asplundcommented, Aug 26, 2019

Just tested the new release and it seems to be working, closing this issue. Big thanks @pauldijou! 🥇

1reaction
travisbrowncommented, Aug 21, 2019

The problem is that there’s no Cats 1.x release for 2.13 (and won’t be, because of ScalaCheck), and no non-milestone, non-RC Cats 2.0 yet, and in any case I wouldn’t want to bump from Cats 1 to Cats 2 in a patch version update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NoClassDefFoundError when using jwt-circe with ...
I'm running into the below exception when trying to use jwt-circe v3.1.0 with http4s v0.20.10. This appears be due to the libraries ...
Read more >
java.lang.NoClassDefFoundError when running webservice ...
I'm getting the following error when I run a webservice client I've created using: eclipse, j2sdk1 ...
Read more >
com.fasterxml.jackson.module.scala.DefaultScalaModule
The following examples show how to use com.fasterxml.jackson.module.scala. ... package com.basho.riak.spark.examples.streaming import java.util.
Read more >
Streaming - http4s
Here's some code intended to consume Twitter's streaming APIs, which return a stream of JSON. First, let's assume we want to use Circe...
Read more >
java.lang.NoClassDefFoundError - Nimbus-JOSE-JWT
I tested the same thing using a maven project standalone and works perfectly fine but in my old java EE code it dies......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found