我在我的 scala 项目中使用电线。我有一个用例---
class SchemaRegistry(registry: SchemaRegistryClient)
class SchemaRegistryClient(url: String) extends RestService(url) {}
trait EndpointModule {
// Schema Registry endpoint dependency
lazy val schemaRegistry: SchemaRegistry = wire[SchemaRegistry]
def schemaRegistryClient(url: String): SchemaRegistryClient = wire[SchemaRegistryClient]
}
object LightweightinstructionRunner extends EndpointModule with ConfigModule {
val client = schemaRegistryClient("")
}
这会引发错误 -
找不到类型的值:[etl.infrastructure.endpoints.SchemaRegistryClient]
如果我在EndpointModule中创建硬编码的SchemaRegistryClient对象,它就可以工作。
(val c = new SchemaRegsitryClient(""))
谁能帮助解释如何解决这个问题以及这里发生了什么?
我似乎无法找到一种方法来满足依赖。
LightweightinstructionRunner在一个 diff 包中,而SchemaRegistry和SchemaRegistryClient在同一个包中。