java - Spring Boot Actuator - "/shutdown" Fails With 500 Error -


background information

i have spring boot web application using actuator production utilities.

the application works fine, , management port works great. can browse statistics, check health etc. enabled remote shut-down endpoint, , shows in localhost:{mgmt_port}/actuator list of endpoints.

my problem

when go localhost:{mgmt_port}/shutdown though, see:

<map>     <timestamp>1453905900007</timestamp>     <status>500</status>     <error>internal server error</error>     <exception>org.springframework.web.httprequestmethodnotsupportedexception</exception>     <message>request method 'get' not supported</message>     <path>/shutdown</path> </map> 

useful information

  • the whole application still seems running after hitting shut-down link. can still pull data custom application endpoints.

  • the management url provided spring actuator seems still running fine after hitting shut down.

console output before issue

10:01:42.496 [main] info o.s.b.c.e.t.tomcatembeddedservletcontainer - tomcat started on port(s): 8002 (http) 10:01:42.499 [main] info com.xyz.api.main - started main in 5.956 seconds (jvm running 6.381)

console output after issue

10:03:29.090 [http-nio-8003-exec-1] info o.a.c.c.c.[tomcat-1].[localhost].[/] - initializing spring frameworkservlet 'dispatcherservlet' 10:03:29.090 [http-nio-8003-exec-1] info o.s.web.servlet.dispatcherservlet - frameworkservlet 'dispatcherservlet': initialization started 10:03:29.126 [http-nio-8003-exec-1] info o.s.web.servlet.dispatcherservlet - frameworkservlet 'dispatcherservlet': initialization completed in 36 ms 10:03:29.151 [http-nio-8003-exec-1] error o.a.c.c.c.[.[.[.[dispatcherservlet] - servlet.service() servlet [dispatcherservlet] in context path [] threw exception [request method 'get' not supported] root cause org.springframework.web.httprequestmethodnotsupportedexception: request method 'get' not supported @ org.springframework.web.servlet.mvc.method.requestmappinginfohandlermapping.handlenomatch(requestmappinginfohandlermapping.java:204) ~[spring-webmvc-4.2.4.release.jar!/:4.2.4.release] @ org.springframework.web.servlet.handler.abstracthandlermethodmapping.lookuphandlermethod(abstracthandlermethodmapping.java:382) ~[spring-webmvc-4.2.4.release.jar!/:4.2.4.release] @ org.springframework.web.servlet.handler.abstracthandlermethodmapping.gethandlerinternal(abstracthandlermethodmapping.java:322) ~[spring-webmvc-4.2.4.release.jar!/:4.2.4.release] @ org.springframework.web.servlet.handler.abstracthandlermethodmapping.gethandlerinternal(abstracthandlermethodmapping.java:60) ~[spring-webmvc-4.2.4.release.jar!/:4.2.4.release] @ org.springframework.web.servlet.handler.abstracthandlermapping.gethandler(abstracthandlermapping.java:351) ~[spring-webmvc-4.2.4.release.jar!/:4.2.4.release] @ org.springframework.boot.actuate.autoconfigure.endpointwebmvcchildcontextconfiguration$compositehandlermapping.gethandler(endpointwebmvcchildcontextconfiguration.java:212) ~[spring-boot-actuator-1.3.2.release.jar!/:1.3.2.release] @ org.springframework.web.servlet.dispatcherservlet.gethandler(dispatcherservlet.java:1120) ~[spring-webmvc-4.2.4.release.jar!/:4.2.4.release] @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:932) ~[spring-webmvc-4.2.4.release.jar!/:4.2.4.release] @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:893) ~[spring-webmvc-4.2.4.release.jar!/:4.2.4.release] @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:969) ~[spring-webmvc-4.2.4.release.jar!/:4.2.4.release] @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:860) ~[spring-webmvc-4.2.4.release.jar!/:4.2.4.release] @ javax.servlet.http.httpservlet.service(httpservlet.java:622) ~[tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:845) ~[spring-webmvc-4.2.4.release.jar!/:4.2.4.release] @ javax.servlet.http.httpservlet.service(httpservlet.java:729) ~[tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:291) ~[tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) ~[tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:212) ~[tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:106) [tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:502) [tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:141) [tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:79) [tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:88) [tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:521) [tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1096) [tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:674) [tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun(nioendpoint.java:1500) [tomcat-embed-core-8.0.30.jar!/:8.0.30] @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.run(nioendpoint.java:1456) [tomcat-embed-core-8.0.30.jar!/:8.0.30] @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) [na:1.8.0_51] @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) [na:1.8.0_51] @ org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61) [tomcat-embed-core-8.0.30.jar!/:8.0.30] @ java.lang.thread.run(unknown source) [na:1.8.0_51]

answering own question others in future. i'm chump... /actuator url lists available commands, , of them work based on get request.

the /shutdown url requires http post sent in order activate though. didn't see noted anywhere in docs.

sample curl command:

> curl -x post http://hostname:8003/shutdown 

output of shutdown command:

<singletonmap><message>shutting down, bye...</message></singletonmap> 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -