【GitLab】Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableExcep

問題:

Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse 
    error: Cannot deserialize instance of `java.lang.String` out of START_OBJECT token; nested exception is 
    com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of
     `java.lang.String` out of START_OBJECT token at [Source: (PushbackInputStream); line: 1, column: 449]
     (through reference chain: java.util.LinkedHashMap["project"])

解決:

這個錯誤是因爲GitLab11.10之後,使用Webhook返回響應JSON對象會無法使用Jackson進行反序列化導致。

因此只需要在SpringCloud配置中心(config server)中增加過濾器代碼進行Json數據序列化就可以了。

網上有很多例子這裏就不貼出代碼了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章