org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'HEAD' not supported
when click Environment Tab , print error log org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'HEAD' not supported the request is 2017-02-06 14:40:31.372 DEBUG 1288 --- [nio-8011-exec-5] o.a.c.authenticator.AuthenticatorBase : Security checking request HEAD /refresh
why is a HEAD request?
The error is ok. The HEAD request is done to detect the spring cloud /refresh endpoint. The error occurs if it is not present.
I have inconsistency with some applications the call to HEAD (/refresh ) works for some of them and the other applications are retuning 500. although all of them the call to POST (/refresh) works. this is resulting in not being able to update configurations from spring boot admin. what can be the cause of the issue? i checked all dependencies they seem all to have the same. and i can see in the logs that /refresh is exposed on method post
2017-02-21 15:00:08.913 INFO [stc_sa-subscribe,,,] 4597 --- [main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/refresh || /refresh.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
Is there some error logged either from the zuul proxy inside the admin server or the application itself ?
@joshiste thanks i found the problem so its because the @RestControllerAdvice class has a @ ExceptionHandler(Exception.class) , which handles the unspecified exceptions by returning 500 and considers it as internal server error. now I am explicitly defining the HttpRequestMethodNotSupportedException to be handled with the default actuator JSON response (405) which the spring boot admin expects everything is normal.