在Corda中,架构无法强制转换为net.corda.core.schemas.MappedSchema异常

时间:2018-08-22 16:01:34

标签: corda

我正在尝试根据说明here为CorDapp创建迁移方案。我正在运行以下命令:

java -jar corda-tools-database-manager-3.1.jar 
--base-directory /opt/User
--create-migration-sql-for-cordapp fnolUseCase.state.FNOLSchema

但是,出现以下错误:

-- 2018-08-22T13:29:23,145Z migration.tool.invoke - Creating database migration 
   files for schema: fnolUseCase.state.FNOLSchema into /opt/User/migration

Failed to create datasource.
Please check that the correct JDBC driver is installed in one of the following 
folders:
         - /opt/User/drivers

Caused By java.lang.ClassCastException: fnolUseCase.state.FNOLSchema cannot be cast 
to net.corda.core.schemas.MappedSchema

我应该怎么做?

1 个答案:

答案 0 :(得分:0)

定位fnolUseCase.state.FNOLSchema类似乎有麻烦。尝试从命令末尾删除模式名称。这将导致为您的应用程序中的每个架构创建一个迁移架构:

java -jar corda-tools-database-manager-3.1.jar 
--base-directory /opt/User
--create-migration-sql-for-cordapp fnolUseCase.state.FNOLSchema