| 63 | |
| 64 | === When running with iPeer Building Block, got error message: Could not read JSON === |
| 65 | The full messages is: |
| 66 | {{{ |
| 67 | org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: |
| 68 | Can not deserialize instance of ca.ubc.ctlt.ipeerb2.domain.User[] out of VALUE_NUMBER_INT token at .... |
| 69 | }}} |
| 70 | |
| 71 | Logging the raw message will reveal that the response message has been chunked with a leading number and ending 0 (http://en.wikipedia.org/wiki/Chunked_transfer_encoding). This cause !RestTemplate doesn't recognize the response and throw the exception. And this has been seen when server is set up with Apache + mod_php + Nginx (1.0.15) Proxy on RHEL 6.5. |
| 72 | |
| 73 | There are several ways to solve this problem: |
| 74 | * Quick workaround: Adding "chunked_transfer_encoding off;" in nginx configuration file to disable the chunked transfer encoding feature. |
| 75 | * A patch has been added to iPeer code base to avoid the response being chunked. This patch will be included in version 3.1.1. |
| 76 | * (Figure out why RestTemplate is not correct parsing chunked response.) |