简体   繁体   中英

Play Framework 2.7.x Compile Time DI Error

Create project from https://github.com/playframework/play-socket.io/tree/master/samples/scala/chat and get compilation error

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

Try with Play 2.6.23 and 2.7.2

Removing the following line from MyApplication should make it work:

override def applicationLifecycle: DefaultApplicationLifecycle

Test it with

  1. git clone https://github.com/playframework/play-socket.io.git
  2. cd play-socket
  3. Remove the override from play-socket.io/samples/scala/chat/app/modules/MyApplicationLoader.scala
  4. sbt "scalaChat/run" from the root project dir play-socket/
  5. Hit http://localhost:9000/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM