解决zuul转发url带冒号报错

报错

java.lang.IllegalArgumentException: Map has no value for 'name'
at org.springframework.web.util.UriComponents$MapTemplateVariables.getValue(UriComponents.java:306) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.util.UriComponents.expandUriComponent(UriComponents.java:230) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.util.HierarchicalUriComponents.expandQueryParams(HierarchicalUriComponents.java:343) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:329) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:47) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.util.UriComponents.expand(UriComponents.java:152) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.util.UriTemplate.expand(UriTemplate.java:97) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper.getQueryString(ProxyRequestHelper.java:274)

解决

升级zuul到1.2.1.RELEASE版本或以上

        
            org.springframework.cloud
            spring-cloud-starter-zuul
            1.2.1.RELEASE
        

about zuul

  • springboot使用zuul

  • zuul配置外部服务的负载均衡

  • zuul超时及重试配置

doc

  • colons-in-parameter-names-going-through-zuul-maybe-spring-related

  • colons in query parameter names causes IllegalArgumentException

你可能感兴趣的:(springboot)