Skip to content

use a different method to obtain the HTTP status code in the JsonRpcRestClient - #358

Open
cyb3r4nt wants to merge 1 commit into
briandilley:masterfrom
cyb3r4nt:fix-status-code-in-json-rpc-rest-client
Open

use a different method to obtain the HTTP status code in the JsonRpcRestClient#358
cyb3r4nt wants to merge 1 commit into
briandilley:masterfrom
cyb3r4nt:fix-status-code-in-json-rpc-rest-client

Conversation

@cyb3r4nt

Copy link
Copy Markdown
Contributor

HttpStatusCodeException.getStatusCode() has been moved in spring-web v6 into parent class RestClientResponseException.

This causes missing methods errors if code is compiled with spring-web v5, but is running with spring-web v6.

java.lang.NoSuchMethodError: 'org.springframework.http.HttpStatus org.springframework.web.client.HttpStatusCodeException.getStatusCode()'
                at com.googlecode.jsonrpc4j.spring.rest.JsonRpcRestClient.invoke(JsonRpcRestClient.java:220)
                at com.googlecode.jsonrpc4j.ProxyUtil$3.invoke(ProxyUtil.java:213)
               ....

Method RestClientResponseException.getRawStatusCode() is present in both spring-web versions, but it is deprecated in spring-web v6. When jsonrpc4j code migrates to spring-web v6 or higher, then this place will need to migrate back to the getStatusCode() method.

HttpStatusCodeException.getStatusCode() has been moved in
spring-web v6 into parent class RestClientResponseException.

This causes missing methods errors if code is compiled with spring-web v5,
but is running with spring-web v6.

Method RestClientResponseException.getRawStatusCode() is present in both
spring-web versions, but it is deprecated in spring-web v6.
When jsonrpc4j code migrates to spring-web v6 or higher,
then this place will need to migrate back to getStatusCode() method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant