Play Framework 2.7.x编译时DI错误

时间:2019-06-15 21:03:01

标签: scala playframework

https://github.com/playframework/play-socket.io/tree/master/samples/scala/chat创建项目并获得编译错误

overriding method applicationLifecycle in trait MyApplication of type => play.api.inject.DefaultApplicationLifecycle;
 lazy value applicationLifecycle in class BuiltInComponentsFromContext of type play.api.inject.ApplicationLifecycle has incompatible type

尝试使用Play 2.6.23和2.7.2

1 个答案:

答案 0 :(得分:1)

MyApplication中删除以下line应该可以正常工作:

override def applicationLifecycle: DefaultApplicationLifecycle

进行测试
  1. git clone https://github.com/playframework/play-socket.io.git
  2. cd play-socket
  3. play-socket.io/samples/scala/chat/app/modules/MyApplicationLoader.scala移除替代项
  4. sbt "scalaChat/run"从根项目目录play-socket/
  5. http://localhost:9000/