CodexBloom - Programming Q&A Platform

best practices for 'java.lang.NoSuchMethodError' when using Scala 3.2.0 with Akka HTTP 10.2.6?

👀 Views: 17 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-14
scala akka akka-http Scala

I'm confused about I'm stuck on something that should probably be simple... I've been banging my head against this for hours. I'm currently experiencing a `java.lang.NoSuchMethodError` when trying to run my Scala application with Akka HTTP 10.2.6 after upgrading to Scala 3.2.0. The application worked perfectly with Scala 2.13, but after the upgrade, I started working with this scenario. The behavior points to a missing method in one of the Akka HTTP classes, specifically `akka.http.scaladsl.server.Directives$.route`. I've made sure that my `build.sbt` is set up correctly with the following dependencies: ```scala scalaVersion := "3.2.0" libraryDependencies ++= Seq( "com.typesafe.akka" %% "akka-http" % "10.2.6", "com.typesafe.akka" %% "akka-stream" % "2.6.16" ) ``` I even tried cleaning and rebuilding the project with `sbt clean compile`, but the scenario continues. Is there a compatibility scenario with Akka HTTP when using Scala 3.2.0? Are there any known workarounds or updates I should be aware of? Also, I noticed that some of the Akka HTTP documentation is not fully updated for Scala 3, which adds to the confusion. Any guidance on how to resolve this would be greatly appreciated! This is for a desktop app running on Linux. I'm working in a Ubuntu 22.04 environment. I'm working with Scala in a Docker container on Windows 11. Is there a simpler solution I'm overlooking?