【问题标题】:IllegalModelException: Namespace is not defined for type org.acme.airline.aircraft.AircraftIllegalModelException:没有为类型 org.acme.airline.aircraft.Aircraft 定义命名空间
【发布时间】:2018-05-03 20:16:37
【问题描述】:

我正在关注有关 Hyperledger 结构的 Udemy 教程。 我想将一个模型文件(或命名空间)导入另一个模型文件。但我收到一个错误。

IllegalModelException: Namespace is not defined for type org.acme.airline.aircraft.Aircraft

我想将 org.acme.airline.aircraft 导入到 org.acme.airline.flight

这两个文件是:-

> 1. org.acme.airline.flight.cto
> 
>     namespace org.acme.airline.flight
>     
>     import org.acme.airline.aircraft.Aircraft
>     
>     asset Flight identified by flightNumber {
>       o String  flightNumber
>       o Route route
>       o String[] aliasFlightNumber
>       --> Aircraft aircraft optional
>     }
>     
>     concept Route {
>       o String origin
>       o String destination
>       o DateTime schedule
>     }
  1. org.acme.airline.aircraft
namespace org.acme.airline.aircraft

  asset Aircraft identified by aircraftId {
  o String aircraftId
  o Ownership ownershiptType default="LEASED"

      o Integer firstClassSeats
      o Integer businessClassSeats
      o Integer economyClassSeats
      o String nickName optional

    }

    enum Ownership {
      o LEASED
      o OWNED
    }

我尝试按照 StackOverflow 上的一个小相关问题中的建议删除 permissions.acl 文件,但错误仍然存​​在。

在 permission.acl 我收到一个错误,

IllegalModelException: Failed to find namespace test.*

【问题讨论】:

    标签: hyperledger-fabric blockchain hyperledger


    【解决方案1】:

    单击此处获取解决方案之一here。 它说:目前,要使用使用导入并跨越多个文件的模型,您必须打开所有相关文件。要验证 ACL 文件和查询文件,还必须打开相应的模型文件。我计划通过允许打开一个文件夹来改进这一点,但从你所说的来看,它听起来像设计的那样工作。

    【讨论】:

      猜你喜欢
      • 2014-10-18
      • 1970-01-01
      • 2014-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多