While running a scalatest after upgrading to Pekko and Play 3.0.1 I got the following error.
I'm using Guice 6.0.0 and scalatestplus-play 7.0.1
[info] Cause: java.lang.ExceptionInInitializerError: Exception java.lang.NoSuchMethodError: 'void play.api.libs.json.KeyReads.$init$(play.api.libs.json.KeyReads)' [in thread "application-pekko.actor.default-dispatcher-7"]
[info] at enumeratum.EnumFormats$$anon$4.<init>(EnumFormats.scala:148)
[info] at enumeratum.EnumFormats$.readsKeyAndExtracts(EnumFormats.scala:148)
[info] at enumeratum.EnumFormats$.keyReads(EnumFormats.scala:35)
[info] at enumeratum.PlayInsensitiveJsonEnum.$init$(PlayInsensitiveJsonEnum.scala:16)
[info] at io.kontainers.validation.model.ModelType$.<clinit>(ModelType.scala:8)
[info] at io.kode.daos.ValidationsDao.<init>(ValidationsDao.scala:26)
[info] at io.kode.daos.ValidationsDao$$FastClassByGuice$$5403b7b.GUICE$TRAMPOLINE(<generated>)
[info] at io.kode.daos.ValidationsDao$$FastClassByGuice$$5403b7b.apply(<generated>)
[info] at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
[info] at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
A possible workaround to get rid of this error requires to exclude transitive dependencies, adding to build.sbt:
excludeDependencies ++= Seq(
// As of Play 3.0, groupId has changed to org.playframework; exclude transitive dependencies to the old artifacts
ExclusionRule(organization = "com.typesafe.play")
)
While running a scalatest after upgrading to Pekko and Play 3.0.1 I got the following error.
I'm using Guice 6.0.0 and
scalatestplus-play
7.0.1A possible workaround to get rid of this error requires to exclude transitive dependencies, adding to
build.sbt
: