Update from 2.6 to 2.7, getting "sourceMapper parameter is no longer supported by createContext"

My company has a little utility that generates a play app with a HealthCheckController (from codahale) that we use to create new microservices. Unfortunately, the generator is based on Play 2.6. I’m trying to update to use 2.7 (and eventually 2.8) to stay current. Although I’ve successfully upgraded some play services that weren’t based on this utility, I’m having the devil’s own time with this code.

When I just run the code, and then send a health check request to the service, I get stack trace that ends up with:

Caused by: java.lang.IllegalArgumentException: requirement failed: sourceMapper parameter is no longer supported by createContext; use create method's devContext parameter instead
	at scala.Predef$.require(Predef.scala:277)
	at play.api.ApplicationLoader$.createContext(ApplicationLoader.scala:216)
	at play.core.server.DevServerStart$$anon$1.$anonfun$reload$3(DevServerStart.scala:172)
	at play.utils.Threads$.withContextClassLoader(Threads.scala:22)
	at play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:171)
	... 24 more

I can’t find any reference in my code to a sourceMapper or createContext.

Can anyone shed any light on this?

Thanks,
-Peter

1 Like

I have this exact problem and would like to see how I can solve it as well.

Hey @pfc and @tanin47,

Can you provide a reproducer for this error?

Best.

Hey @marcospereira and @pfc,

The root cause is the dependency conflict between 2.6.x and 2.8.x. I didn’t change all dependencies to 2.8.x, there were some play-related libraries in 2.6.x

You can use sbt dependencyTree to see if there’s any play-related libraries left.