FeignClient Caused by: java.lang.IllegalArgumentException

在项目中遇见好几次这个bug,被坑很多次,而且很难找出问题所在

Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 81: http://monntor/api/uur/test/e7e0ff2c-0f10-4705-a3a7-d410d0b9d08d/heat{heat}/list/95374904-232d-4731-a9db-417296c54aca

        at java.net.URI.create(URI.java:852)
        at org.springframework.cloud.netflix.feign.ribbon.LoadBalancerFeignClient.execute(LoadBalancerFeignClient.java:56)
        at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:97)
        at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:76)
        at feign.hystrix.HystrixInvocationHandler$1.run(HystrixInvocationHandler.java:108)
        at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:301)
        at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:297)
        at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46)

        ... 168 common frames omitted

可以看出,client的地址没有解析出来,博主反复查找client中是否有错误,最后发现是调用这个client接口的

时候heat这个值传过来的是null,导致url解析出错。

你可能感兴趣的:(SpringCloud)