@SpringBootApplication
@EnableConfigServer
public class App {
public static void main(String[] args) {
SpringApplication.run(ConfigServerApplication.class,args);
}
}
curl -x post localhost:8040/admin/restart
app.jar reported error:
2019-02-26 11:01:38.409 ERROR 7764 --- [ Thread-8] o.s.boot.SpringApplication : Application startup failed
java.lang.IllegalStateException: org.springframework.context.annotation.AnnotationConfigApplicationContext@4b86805d has been closed already
at org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:1064) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1175) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.getOrderedBeansOfType(BootstrapApplicationListener.java:310) ~[spring-cloud-context-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.apply(BootstrapApplicationListener.java:284) ~[spring-cloud-context-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:105) ~[spring-cloud-context-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:68) ~[spring-cloud-context-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) ~[spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325) ~[spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:296) ~[spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.cloud.context.restart.RestartEndpoint.restart(RestartEndpoint.java:167) [spring-cloud-context-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.cloud.context.restart.RestartEndpoint.invoke(RestartEndpoint.java:99) [spring-cloud-context-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.cloud.context.restart.RestartEndpoint.invoke(RestartEndpoint.java:48) [spring-cloud-context-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.actuate.endpoint.mvc.AbstractEndpointMvcAdapter.invoke(AbstractEndpointMvcAdapter.java:56) [spring-boot-actuator-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke(EndpointMvcAdapter.java:42) [spring-boot-actuator-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.cloud.context.restart.RestartMvcEndpoint.access$001(RestartMvcEndpoint.java:34) [spring-cloud-context-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.cloud.context.restart.RestartMvcEndpoint$1.run(RestartMvcEndpoint.java:51) [spring-cloud-context-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]
2019-02-26 11:01:38.409 INFO 7764 --- [ Thread-8] o.s.c.context.restart.RestartEndpoint : Could not restart: org.springframework.context.annotation.AnnotationConfigApplicationContext@4b86805d has been closed already
POM.xml
application.yml
App.java
curl -x post localhost:8040/admin/restart
app.jar reported error: