play 2.6 conflicting members when using AbstractController(components) instead of Controller

201 views
Skip to first unread message

Francis De Brabandere

unread,
Jul 9, 2017, 2:59:42 PM7/9/17
to ReactiveMongo - http://reactivemongo.org
It seems that the play reactive mongo lib (as documented) is only compatible with the deprecated 'extends Controller' and not with the new `extends AbstractController(components)`

class Application(...) extends extends AbstractController(components) with MongoController with ReactiveMongoComponents

[error] [1] /app/controllers/Application.scala:14:
[error]     class Application inherits conflicting members:
[error]       method parse in trait BaseControllerHelpers of type => play.api.mvc.PlayBodyParsers  and
[error]       lazy value parse in trait BodyParsers of type play.api.mvc.PlayBodyParsers
[error]     (Note: this can be resolved by declaring an override in class Application.)
[error]     class Application(
[error]           ^

Am I doing something wrong or is this still in development? Could not find any related ticket / documentation.

Cheers,
Francis

Cédric Chantepie

unread,
Jul 9, 2017, 3:38:13 PM7/9/17
to ReactiveMongo - http://reactivemongo.org
That would more be a Play issue. The deprecated type should still be compatible.

binoy...@gmail.com

unread,
Jul 14, 2017, 1:57:12 PM7/14/17
to ReactiveMongo - http://reactivemongo.org
I faced the same thing, I removed the reliance on MongoController, and only used ReacticeMongoComponent.

class ClientConfig @Inject()(val configuration: play.api.Configuration,
                             val dbAdminHelper: DBAdminHelper,
                             val system: ActorSystem,
                             val reactiveMongoApi: ReactiveMongoApi,
                             val ws: WSClient,
                             override val controllerComponents: ControllerComponents)
                           
(implicit exec: ExecutionContext,val futures: Futures) extends AbstractController(controllerComponents) with ReactiveMongoComponents {


I am not sure what purpose does extending MongoController provide 
Reply all
Reply to author
Forward
0 new messages