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:
- [Solved] Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerExcepti
- [Solved] eureka Startup Error: Unable to start web … nested exception is org.springframework.boot.web.server.WebS
- [Solved] eureka Startup Error: Unable to start web … nested exception is org.springframework.boot.web.server.WebS
- Feign Error: Load balancer does not have available server for client:XXX
- [Solved] Web server failed to start. Port 8080 was already in use.
- [Solved] Maven Project Error: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- IDEA Create Web Project with maven Error: The desired archetype does not exista…
- [Solved] SpringBoot Startup Error: Description:Web server failed to start. Port 9090 was already in use.(win10)
- SpringCloud: Error creating bean with name ‘configurationPropertiesBeans‘
- Springcloud builds a gateway and starts Error [Solved]
- There was an unexpected error (type=Internal Server Error, status=500).Invalid bound statement (not
- [Solved] springCloud Startup Error: Error creating bean with name ‘defaultValidator‘ defined in class path resource
- [Solved] Springboot Project Error: Mail server connection failed;
- [Solved] Springcloud Add Eureka to Startup Error
- How to Solve Error-SpringCloud-Feign and Sentinel integrate error
- springcloud alibaba Integrating nacos reports errors: create config service error!properties=NacosConfigPropertie
- [ERROR] Failed to execute goal on project simple-project: Could not resolve dependencies for project
- [Solved] ApiPost Error: org.springframework.web.multipart.MultipartException
- SpringCloud Use openFeign Multipartfile to Upload Files Error: Current request is not a multipart request
- [Solved] org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is