Skip to content

Commit 4d26766

Browse files
committed
Use different constructor of HttpMessageNotReadableException in the MappingJacksonRPC2HttpMessageConverter.readInternal()
Spring Framework 5.1 (spring-web) has deprecated the usage of constructor without httpInputMessage parameter. Other constructor needs to be used instead. Signed-off-by: cyb3r4nt <[email protected]>
1 parent 755cccd commit 4d26766

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/com/googlecode/jsonrpc4j/spring/rest/MappingJacksonRPC2HttpMessageConverter.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ protected boolean supports(Class<?> clazz) {
138138

139139
@Override
140140
protected Object readInternal(Class<?> clazz, HttpInputMessage inputMessage)
141-
throws IOException, HttpMessageNotReadableException {
141+
throws HttpMessageNotReadableException {
142142

143143
JavaType javaType = getJavaType(clazz);
144144
try {
145145
return this.objectMapper.readValue(inputMessage.getBody(), javaType);
146146
} catch (IOException ex) {
147-
throw new HttpMessageNotReadableException("Could not read JSON: " + ex.getMessage(), ex);
147+
throw new HttpMessageNotReadableException(
148+
"Could not read JSON: " + ex.getMessage(),
149+
ex,
150+
inputMessage
151+
);
148152
}
149153
}
150154

0 commit comments

Comments
 (0)