【发布时间】:2018-02-15 22:29:11
【问题描述】:
我正在使用 MacWire DI 框架,但出现此错误。
Found multiple values of type [play.api.mvc.DefaultActionBuilder]: [List(defaultActionBuilder, Action)]
[error] override lazy val controllerComponents: DefaultControllerComponents = wire[DefaultControllerComponents]
我的应用程序加载器是这样的:
class AppApplicationLoader extends ApplicationLoader {
def load(context: Context) = {
LoggerConfigurator(context.environment.classLoader).foreach { cfg =>
cfg.configure(context.environment)
}
new AppComponents(context).application
}
}
class AppComponents(context: Context) extends
BuiltInComponentsFromContext(context) with AhcWSComponents
with AssetsComponents with HttpFiltersComponents
with EvolutionsComponents with DBComponents with HikariCPComponents with EhCacheComponents {
override lazy val controllerComponents: DefaultControllerComponents = wire[DefaultControllerComponents]
在对代码进行小幅修改后,我遇到了一些其他类似的错误。如何按照 DI 依赖项来追踪这些错误?
【问题讨论】:
标签: scala playframework-2.0 playframework-2.6 macwire