Springcloud Project Error: web.client.HttpServerErrorException$InternalServerError: 500 Internal Server Error

Question

In the springcloud project, the consumer module uses resttemplate to call the provider module. When accessing a method in the consumer module, the following error occurs:

org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Internal Server Error
	at org.springframework.web.client.HttpServerErrorException.create(HttpServerErrorException.java:79) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:125) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:102) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:785) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:743) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]

Solution:

When I first saw the error of 500, I naturally thought it was the problem of background service. However, the log information in the consumer module was relatively general, so it was difficult to locate the problem. After checking, it was found that an error occurred when the consumer used resttemplate to call the provider service , so check the log of the provider module, and sure enough, more detailed error information was found:

java.lang.IllegalArgumentException: Parameter value [2021-10-25] did not match expected type [java.util.Date (n/a)]

Then the problem will be solved

Read More: