Playframework 自我类型不符合Play2ReactiveMono的错误
将play2reactivemongo升级到0.11.0.play24后,我遇到以下错误。代码在升级之前编译良好 代码: 错误消息:Playframework 自我类型不符合Play2ReactiveMono的错误,playframework,reactivemongo,Playframework,Reactivemongo,将play2reactivemongo升级到0.11.0.play24后,我遇到以下错误。代码在升级之前编译良好 代码: 错误消息: self-type controllers.TestController.type does not conform to play.modules.reactivemongo.MongoController's selftype play.modules.reactivemongo.MongoController with play.api.mvc.Contro
self-type controllers.TestController.type does not conform to play.modules.reactivemongo.MongoController's selftype play.modules.reactivemongo.MongoController with play.api.mvc.Controller with play.modules.reactivemongo.ReactiveMongoComponents
一旦Play 2.4引入了新的依赖项注入,您的Mongo控制器就必须
使用ReactiveMongoComponents
(Play.modules.reactivemongo.ReactiveMongoComponents)扩展MongoController
新特性表明,在编译时必须为控制器提供一个reactiveMongoApi:reactiveMongoApi
(play.modules.reactivemongo.reactiveMongoApi)
然后,如果要自动注入此reactiveMongoApi
,则必须按照中指示的步骤进行操作
self-type controllers.TestController.type does not conform to play.modules.reactivemongo.MongoController's selftype play.modules.reactivemongo.MongoController with play.api.mvc.Controller with play.modules.reactivemongo.ReactiveMongoComponents