搜索
您的当前位置:首页正文

The elements [spring.cloud.gateway.routes[0].predicates[0].path] were left unbound.

来源:步旅网

报错文字版:

Binding to target [Bindable@7a254e9b type = java.util.List<org.springframework.cloud.gateway.handler.predicate.PredicateDefinition>, value = 'provided', annotations = array<Annotation>[@javax.validation.constraints.NotEmpty(message={javax.validation.constraints.NotEmpty.message}, groups=[], payload=[]), @javax.validation.Valid()]] failed:

    Property: spring.cloud.gateway.routes[0].predicates[0].path
    Value: /payment/get/**
    Origin: class path resource [application.yml]:13:21
    Reason: The elements [spring.cloud.gateway.routes[0].predicates[0].path] were left unbound.

报错截图:

网关配置文件中代码:

spring:
  application:
    name: cloud-gateway
  cloud:
    gateway:
      routes:
        - id: payment_route
          uri: http://localhost:8001
          predicates:
            - Path: /payment/get/**

        - id: payment_route2
          uri: http://localhost:8001
          predicates:
            - Path: /payment/lb/**

报错原因:

- Path后应该紧跟着路由信息,不要留空格

因篇幅问题不能全部显示,请点此查看更多更全内容

Top