无法加载CordaService

时间:2018-05-15 11:24:43

标签: corda

我有一个看起来像这样的CordaService:

@CordaService
class MyService(private val services: AppServiceHub) : SingletonSerializeAsToken() {
  private companion object {
    private val log = loggerFor<MyService>()
    init {
      BraidCordaJacksonInit.init()
    }
  }

  init {
    println("***** MyService Initializing ****") 
  }
}

这项服务一直表现良好。由于未知原因,它不再由运行时初始化。

节点的日志显示已成功识别并加载了cordapp:

I 12:13:58+0100 [main] Main.printBasicNodeInfo - Loaded CorDapps                         : my-cordapp-0.1, corda-core-3.1-corda {}

如果我使用NodeDriver运行节点:

fun main(args: Array<String>) {
  driver(DriverParameters(
      isDebug = true,
      waitForAllNodesToFinish = true,
      startNodesInProcess = true) {
    listOf(
        startNode(providedName = CordaX500Name("PartyA", "London", "GB"))
    ).map { it.getOrThrow() }
  }
}

... corda服务已正确初始化:

***** MyService Initializing ****
[INFO ] 12:17:09,934 [driver-pool-thread-0] (AbstractNode.kt:487) internal.Node.installCordaService - Installed io.bluebank.MyService Corda service {}

是否需要添加一些特定内容以鼓励扫描仪找到课程?

谢谢, 起毛

1 个答案:

答案 0 :(得分:1)

这是我们的错。有人从./build.gradle deployNodes配置中移除了cordapp!