Problem with Route containing Request in 2.7 Java

I am having trouble migrating to Play 2.7, specifically w.r.t. a controller that needs a Request parameter. Following the documentation, I coded my controller as:
public CompletionStage notifyAction(Http.Request request) {
and my route file contains:
POST /api/notify controllers.NotifyController.notifyAction(request: Request)

But when I try to build, I get the following errors:
[error] /fakePath/conf/routes:10:1: not found: type Request
[error] POST /api/notify controllers.NotifyController.notifyAction(request: Request)
[error] /fakePath/conf/routes:10:1: not found: type Request
[error] POST /api/notify controllers.NotifyController.notifyAction(request: Request)
[warn] /fakePath/conf/routes: Unused import
[error] /fakePath/conf/routes:10:1: not found: type Request
[error] POST /api/notify controllers.NotifyController.notifyAction(request: Request)
[warn] /fakePath/conf/routes: Unused import
[error] /fakePath/conf/routes:10:1: trait Request takes type parameters
[error] POST /api/notify controllers.NotifyController.notifyAction(request: Request)
[error] /fakePath/conf/routes:10:1: trait Request takes type parameters
[error] POST /api/notify controllers.NotifyController.notifyAction(request: Request)
[error] /fakePath/conf/routes:10:1: trait Request takes type parameters
[error] POST /api/notify controllers.NotifyController.notifyAction(request: Request)
[warn] /fakePath/conf/routes: Unused import
[warn] /fakePath/conf/routes:10:1: private val controllers_NotifyController_notifyAction2_invoker in class Routes is never used
[warn] POST /api/notify controllers.NotifyController.notifyAction(request: Request)
[warn] /fakePath/app/views/index.scala.html:1:1: Unused import

I’ve tried fully qualifying the Request type in either or both places and I still get no joy.

Can anyone point me to where I might be going on?

Thanks,
-Peter

Did you enable the PlayJava plugin in build.sbt?

lazy val root = (project in file(".")).enablePlugins(PlayJava)

Yes, it is there. This application has been working for 1.5 years under Play 2.6. Migrating to 2.7 is where I’m having problems.

It turned out that there was still a reference to Play 2.6.2 in a plugins.sbt file hidden in my project directory.

Thank you for your help, Matthias.

1 Like