Hi, In this blog we will discuss some of the challenges we faced while migrating lagom version from 1.3.x to 1.4.x that can be helpful if you are thinking to migrate your lagom version. But firstly we will see the versions we should have for Scala, Play and Akka.
Play and Akka Versions
While migrating Play and Akka version too needs to upgrade. With Lagom 1.4.x Play version should be 2.6.x and Akka version should be 2.5.x.
Also, Scala version needs to upgraded to 2.12.x corresponding to the version upgrade for Lagom.
Sbt Conductr Version
If using sbt-conductr in your project you need to upgrade the version to 2.5.1 or later.
Earlier we were binding service in lagom using the following method which has been deprecated now in 1.4.x:
lazy val lagomServer = LagomServer.forServices(bindService[Service].to(wire[ServiceImpl]))
which has been replaced with:
lazy val lagomServer = serverFor[Service](wire[ServiceImpl])
If you are using play.Configuration to load configuration from your application.conf then, it is time to switch to com.typesafe.config.Config as play.Configuration has been deprecated in Lagom 1.4.x.
Whenever you knock down with such an error:
It can be that some dependencies are still using the old version of scala transitively which you can check using the dependency tree command :
sbt "inspect tree clean"
So, you can exclude those transitive dependencies after figuring out the same from the dependency tree.
FasterXml Jackson Exception:
If you are using Jackson dependency with Lagom you need to have below dependencies with the same version:
Otherwise, you will face the exception mentioned below:
Also, it can be that you are getting some kind of Akka warning while trying to deploy on DC/OS:
In that case, there is a solution for that you need to provide a configuration in your application.conf:
play.server.akka.default-host-header = "www.localhost.com"
There are various other changes you need to do while migrating to Lagom 1.4.x version according to your use case and scenario. Just shared some major challenges faced while migrating Lagom version. Hope it helped!! 🙂