![](/img/trans.png)
[英]Netflix Feign: Response Body empty in ErrorDecoder on 404
[英]com.netflix.feign NullPointerException in Response class
我與假客戶有問題。 我有三個通過假裝彼此通信的模塊。 它看起來像這樣:
moduleA <---假冒---> moduleB <----假冒----> moduleC
當moduleC被發送到moduleB全成響應出現我的問題。 我分析了假冒的核心課程,並找到了原因。
package feign;
public final class Response {
private final int status;
private final String reason;
private final Map<String, Collection<String>> headers;
private final Body body;
private Response(int status, String reason, Map<String, Collection<String>> headers, Body body) {
checkState(status >= 200, "Invalid status code: %s", status); //my status is 200
this.status = status;
this.reason = checkNotNull(reason, "reason"); // my reason is unfortunatelly null
LinkedHashMap<String, Collection<String>>
copyOf =
new LinkedHashMap<String, Collection<String>>();
copyOf.putAll(checkNotNull(headers, "headers"));
this.headers = Collections.unmodifiableMap(copyOf);
this.body = body; //nullable
}
}
在偽核心類的響應中,當方法checkNotNull(reason,“ reason”)被觸發時,即使響應狀態為200,也會出現NullPointerException。如何解決它?
編輯:我的假裝版本是8.1.1
EDIT2:我的tomcat版本是8.5.20
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.