spring-cloud-alibaba
spring-cloud-alibaba copied to clipboard
2021.0.4.0 下重启应用,错误 UT015023: This Context has been already destroyed
2022-09-16 16:11:50.909 ERROR 20048 --- [ Thread-40] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: UT015023: This Context has been already destroyed at io.undertow.servlet.spec.ServletContextImpl.getDeploymentInfo(ServletContextImpl.java:211) at io.undertow.servlet.spec.ServletContextImpl.getInitParameter(ServletContextImpl.java:444) at org.springframework.web.context.support.ServletContextPropertySource.getProperty(ServletContextPropertySource.java:47) at org.springframework.web.context.support.ServletContextPropertySource.getProperty(ServletContextPropertySource.java:33) at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver$DefaultResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:123) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.findPropertyValue(ConfigurationPropertySourcesPropertyResolver.java:97) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:74) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:65) at org.springframework.core.env.AbstractPropertyResolver.getProperty(AbstractPropertyResolver.java:175) at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:610) at org.springframework.cloud.util.PropertyUtils.bootstrapEnabled(PropertyUtils.java:49) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:99) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:77) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66)
Please show your Spring Boot and Spring Cloud version, we solved the problem before, you can see #2652
This is the version number information I currently use
<spring-boot.version>2.7.3</spring-boot.version>
<spring-boot-admin.version>2.7.4</spring-boot-admin.version>
<spring-cloud.version>2021.0.4</spring-cloud.version>
<spring-cloud-alibaba.version>2021.0.4.0</spring-cloud-alibaba.version>
也许跟undertow容器有关,换tomcat试试
This is the version number information I currently use
<spring-boot.version>2.7.3</spring-boot.version> <spring-boot-admin.version>2.7.4</spring-boot-admin.version> <spring-cloud.version>2021.0.4</spring-cloud.version> <spring-cloud-alibaba.version>2021.0.4.0</spring-cloud-alibaba.version>
I didn't reproduce you result. Everything is alright! This is my logs below:
2022-09-21 08:49:23.125 INFO 81538 --- [ main] c.example.provider.ProviderApplication : Starting ProviderApplication using Java 1.8.0_291 on B-P7W6MD6R-0029.local with PID 81538 (/Users/raozihao/IdeaProjects/test-project/agent-test-case/sca-provider-H-nacos/target/classes started by raozihao in /Users/raozihao/IdeaProjects/test-project/agent-test-case)
2022-09-21 08:49:23.128 INFO 81538 --- [ main] c.example.provider.ProviderApplication : No active profile set, falling back to 1 default profile: "default"
2022-09-21 08:49:23.716 INFO 81538 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=56652540-e29d-3a87-a543-5e9038c32f7e
2022-09-21 08:49:23.918 WARN 81538 --- [ main] io.undertow.websockets.jsr : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2022-09-21 08:49:23.939 INFO 81538 --- [ main] io.undertow.servlet : Initializing Spring embedded WebApplicationContext
2022-09-21 08:49:23.939 INFO 81538 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 741 ms
2022-09-21 08:49:24.333 INFO 81538 --- [ main] com.alibaba.nacos.common.remote.client : [RpcClientFactory] create a new rpc client of e6036a9b-978e-4310-91e7-2b3b6188af51
2022-09-21 08:49:24.368 INFO 81538 --- [ main] org.reflections.Reflections : Reflections took 23 ms to scan 1 urls, producing 3 keys and 6 values
2022-09-21 08:49:24.391 INFO 81538 --- [ main] org.reflections.Reflections : Reflections took 13 ms to scan 1 urls, producing 4 keys and 9 values
2022-09-21 08:49:24.403 INFO 81538 --- [ main] org.reflections.Reflections : Reflections took 11 ms to scan 1 urls, producing 3 keys and 10 values
2022-09-21 08:49:24.505 INFO 81538 --- [ main] org.reflections.Reflections : Reflections took 100 ms to scan 92 urls, producing 0 keys and 0 values
2022-09-21 08:49:24.520 INFO 81538 --- [ main] org.reflections.Reflections : Reflections took 14 ms to scan 1 urls, producing 1 keys and 5 values
2022-09-21 08:49:24.539 INFO 81538 --- [ main] org.reflections.Reflections : Reflections took 17 ms to scan 1 urls, producing 1 keys and 7 values
2022-09-21 08:49:24.567 INFO 81538 --- [ main] org.reflections.Reflections : Reflections took 26 ms to scan 1 urls, producing 2 keys and 8 values
2022-09-21 08:49:24.687 INFO 81538 --- [ main] org.reflections.Reflections : Reflections took 118 ms to scan 92 urls, producing 0 keys and 0 values
2022-09-21 08:49:24.688 INFO 81538 --- [ main] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] RpcClient init label, labels = {module=naming, source=sdk}
2022-09-21 08:49:24.690 INFO 81538 --- [ main] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] RpcClient init, ServerListFactory = com.alibaba.nacos.client.naming.core.ServerListManager
2022-09-21 08:49:24.690 INFO 81538 --- [ main] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] Registry connection listener to current client:com.alibaba.nacos.client.naming.remote.gprc.redo.NamingGrpcRedoService
2022-09-21 08:49:24.690 INFO 81538 --- [ main] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] Register server push request handler:com.alibaba.nacos.client.naming.remote.gprc.NamingPushRequestHandler
2022-09-21 08:49:24.691 INFO 81538 --- [ main] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] Try to connect to server on start up, server: {serverIp = 'localhost', server main port = 8848}
2022-09-21 08:49:25.270 INFO 81538 --- [ main] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] Success to connect to server [localhost:8848] on start up, connectionId = 1663721365102_127.0.0.1_61974
2022-09-21 08:49:25.271 INFO 81538 --- [t.remote.worker] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] Notify connected event to listeners.
2022-09-21 08:49:25.271 INFO 81538 --- [ main] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
2022-09-21 08:49:25.272 INFO 81538 --- [ main] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda$571/1687293378
2022-09-21 08:49:25.342 INFO 81538 --- [ main] io.undertow : starting server: Undertow - 2.2.19.Final
2022-09-21 08:49:25.346 INFO 81538 --- [ main] org.xnio : XNIO version 3.8.7.Final
2022-09-21 08:49:25.350 INFO 81538 --- [ main] org.xnio.nio : XNIO NIO Implementation Version 3.8.7.Final
2022-09-21 08:49:25.371 INFO 81538 --- [ main] org.jboss.threads : JBoss Threads version 3.1.0.Final
2022-09-21 08:49:25.408 INFO 81538 --- [ main] o.s.b.w.e.undertow.UndertowWebServer : Undertow started on port(s) 61975 (http)
2022-09-21 08:49:25.418 INFO 81538 --- [ main] c.a.c.n.registry.NacosServiceRegistry : nacos registry, DEFAULT_GROUP service-provider 192.168.31.83:61975 register finished
2022-09-21 08:49:25.431 INFO 81538 --- [ main] c.example.provider.ProviderApplication : Started ProviderApplication in 2.681 seconds (JVM running for 3.743)
2022-09-21 08:49:25.916 INFO 81538 --- [ent-executor-11] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] Receive server push request, request = NotifySubscriberRequest, requestId = 10
2022-09-21 08:49:25.919 INFO 81538 --- [ent-executor-11] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] Ack server push request, request = NotifySubscriberRequest, requestId = 10
2022-09-21 08:49:30.376 WARN 81538 --- [ Thread-12] c.a.n.common.http.HttpClientBeanHolder : [HttpClientBeanHolder] Start destroying common HttpClient
2022-09-21 08:49:30.377 WARN 81538 --- [ Thread-9] c.a.nacos.common.notify.NotifyCenter : [NotifyCenter] Start destroying Publisher
2022-09-21 08:49:30.377 WARN 81538 --- [ Thread-9] c.a.nacos.common.notify.NotifyCenter : [NotifyCenter] Destruction of the end
2022-09-21 08:49:30.377 WARN 81538 --- [ Thread-12] c.a.n.common.http.HttpClientBeanHolder : [HttpClientBeanHolder] Destruction of the end
2022-09-21 08:49:30.379 INFO 81538 --- [ionShutdownHook] io.undertow : stopping server: Undertow - 2.2.19.Final
2022-09-21 08:49:30.416 INFO 81538 --- [ionShutdownHook] c.a.c.n.registry.NacosServiceRegistry : De-registering from Nacos Server now...
2022-09-21 08:49:30.433 INFO 81538 --- [ionShutdownHook] c.a.c.n.registry.NacosServiceRegistry : De-registration finished.
2022-09-21 08:49:30.939 INFO 81538 --- [ent-executor-18] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] Receive server push request, request = NotifySubscriberRequest, requestId = 11
2022-09-21 08:49:30.940 INFO 81538 --- [ent-executor-18] com.alibaba.nacos.common.remote.client : [e6036a9b-978e-4310-91e7-2b3b6188af51] Ack server push request, request = NotifySubscriberRequest, requestId = 11
2022-09-21 08:49:31.046 INFO 81538 --- [ionShutdownHook] com.alibaba.nacos.common.remote.client : Shutdown rpc client, set status to shutdown
2022-09-21 08:49:31.046 INFO 81538 --- [ionShutdownHook] com.alibaba.nacos.common.remote.client : Shutdown client event executor java.util.concurrent.ScheduledThreadPoolExecutor@1cc8349[Running, pool size = 2, active threads = 2, queued tasks = 0, completed tasks = 0]
2022-09-21 08:49:31.046 INFO 81538 --- [ionShutdownHook] com.alibaba.nacos.common.remote.client : Close current connection 1663721365102_127.0.0.1_61974
2022-09-21 08:49:31.049 INFO 81538 --- [ionShutdownHook] c.a.n.c.remote.client.grpc.GrpcClient : Shutdown grpc executor java.util.concurrent.ThreadPoolExecutor@3eea98e0[Running, pool size = 19, active threads = 0, queued tasks = 0, completed tasks = 19]
This is my pom.xml below:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>sca-provider-H-nacos</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<java.version>1.8</java.version>
<spring-cloud-alibaba.version>2021.0.4.0</spring-cloud-alibaba.version>
<spring-cloud.version>2021.0.4</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring-cloud-alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
The restart under Tomcat
container is successful, but the restart under undertow
fails
This is my logs below:
`2022-09-21 14:00:06.198 INFO 17436 --- [kground-preinit] o.h.validator.internal.util.Version : HV000001: Hibernate Validator 6.2.4.Final
2022-09-21 14:00:06.827 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 24 ms to scan 1 urls, producing 3 keys and 6 values 2022-09-21 14:00:06.852 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 13 ms to scan 1 urls, producing 4 keys and 9 values 2022-09-21 14:00:06.864 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 10 ms to scan 1 urls, producing 3 keys and 10 values 2022-09-21 14:00:06.988 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 122 ms to scan 214 urls, producing 0 keys and 0 values 2022-09-21 14:00:07.000 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 10 ms to scan 1 urls, producing 1 keys and 5 values 2022-09-21 14:00:07.012 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 11 ms to scan 1 urls, producing 1 keys and 7 values 2022-09-21 14:00:07.024 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 10 ms to scan 1 urls, producing 2 keys and 8 values 2022-09-21 14:00:07.141 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 115 ms to scan 214 urls, producing 0 keys and 0 values 2022-09-21 14:00:07.797 WARN 17436 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[test-file] & group[DEFAULT_GROUP] 2022-09-21 14:00:07.807 WARN 17436 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[test-file.yml] & group[DEFAULT_GROUP] 2022-09-21 14:00:07.817 INFO 17436 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-test-file-dev.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-test-file.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-test-file,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-application-dev.yml,DEFAULT_GROUP'}] 2022-09-21 14:00:07.824 INFO 17436 --- [ main] com.byd.test.file.testFileApplication : The following 1 profile is active: "dev" 2022-09-21 14:00:08.893 INFO 17436 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=8f79de01-2e68-3ca3-a7eb-b13c2fb76c5f 2022-09-21 14:00:09.047 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration' of type [org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.048 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.048 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'loadBalancerClientsDefaultsMappingsProvider' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration$$Lambda$403/15107073] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.050 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'defaultsBindHandlerAdvisor' of type [org.springframework.cloud.commons.config.DefaultsBindHandlerAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.055 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'swagger-com.byd.test.common.swagger.support.SwaggerProperties' of type [com.byd.test.common.swagger.support.SwaggerProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.057 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'SwaggerAutoConfiguration' of type [com.byd.test.common.swagger.config.SwaggerAutoConfiguration$$EnhancerBySpringCGLIB$$56428158] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.217 INFO 17436 --- [ main] io.undertow.servlet : Initializing Spring embedded WebApplicationContext 2022-09-21 14:00:09.218 INFO 17436 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1381 ms 2022-09-21 14:00:09.996 INFO 17436 --- [ main] c.a.c.sentinel.SentinelWebMvcConfigurer : [Sentinel Starter] register SentinelWebInterceptor with urlPatterns: [/**]. 2022-09-21 14:00:10.251 INFO 17436 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 16 endpoint(s) beneath base path '/actuator' INFO: Sentinel log output type is: file INFO: Sentinel log charset is: utf-8 INFO: Sentinel log base directory is: C:\Users\Ja\logs\csp INFO: Sentinel log name use pid is: false INFO: Sentinel log level is: INFO 2022-09-21 14:00:11.172 INFO 17436 --- [ main] io.undertow : starting server: Undertow - 2.2.19.Final 2022-09-21 14:00:11.177 INFO 17436 --- [ main] org.xnio : XNIO version 3.8.7.Final 2022-09-21 14:00:11.181 INFO 17436 --- [ main] org.xnio.nio : XNIO NIO Implementation Version 3.8.7.Final 2022-09-21 14:00:11.205 INFO 17436 --- [ main] org.jboss.threads : JBoss Threads version 3.1.0.Final 2022-09-21 14:00:11.248 INFO 17436 --- [ main] o.s.b.w.e.undertow.UndertowWebServer : Undertow started on port(s) 5002 (http) 2022-09-21 14:00:11.260 INFO 17436 --- [ main] c.a.c.n.registry.NacosServiceRegistry : nacos registry, DEFAULT_GROUP test-file 192.168.10.10:5002 register finished 2022-09-21 14:00:11.474 INFO 17436 --- [ main] com.byd.test.file.testFileApplication : Started testFileApplication in 5.849 seconds (JVM running for 6.401) 2022-09-21 14:00:11.478 INFO 17436 --- [ main] c.a.c.n.refresh.NacosContextRefresher : [Nacos Config] Listening config: dataId=test-file, group=DEFAULT_GROUP 2022-09-21 14:00:11.478 INFO 17436 --- [ main] c.a.c.n.refresh.NacosContextRefresher : [Nacos Config] Listening config: dataId=test-file-dev.yml, group=DEFAULT_GROUP 2022-09-21 14:00:11.479 INFO 17436 --- [ main] c.a.c.n.refresh.NacosContextRefresher : [Nacos Config] Listening config: dataId=test-file.yml, group=DEFAULT_GROUP 2022-09-21 14:00:11.479 INFO 17436 --- [ main] c.a.c.n.refresh.NacosContextRefresher : [Nacos Config] Listening config: dataId=application-dev.yml, group=DEFAULT_GROUP 2022-09-21 14:00:33.348 INFO 17436 --- [ XNIO-1 task-1] io.undertow.servlet : Initializing Spring DispatcherServlet 'dispatcherServlet' 2022-09-21 14:00:33.348 INFO 17436 --- [ XNIO-1 task-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2022-09-21 14:00:33.350 INFO 17436 --- [ XNIO-1 task-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms 2022-09-21 14:01:12.277 INFO 17436 --- [ Thread-35] io.undertow : stopping server: Undertow - 2.2.19.Final 2022-09-21 14:01:12.280 INFO 17436 --- [ Thread-35] io.undertow.servlet : Destroying Spring FrameworkServlet 'dispatcherServlet' 2022-09-21 14:01:12.291 INFO 17436 --- [ Thread-35] c.a.c.n.registry.NacosServiceRegistry : De-registering from Nacos Server now... 2022-09-21 14:01:12.299 INFO 17436 --- [ Thread-35] c.a.c.n.registry.NacosServiceRegistry : De-registration finished. 2022-09-21 14:01:12.651 ERROR 17436 --- [ Thread-35] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: UT015023: This Context has been already destroyed at io.undertow.servlet.spec.ServletContextImpl.getDeploymentInfo(ServletContextImpl.java:211) at io.undertow.servlet.spec.ServletContextImpl.getInitParameter(ServletContextImpl.java:444) at org.springframework.web.context.support.ServletContextPropertySource.getProperty(ServletContextPropertySource.java:47) at org.springframework.web.context.support.ServletContextPropertySource.getProperty(ServletContextPropertySource.java:33) at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver$DefaultResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:123) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.findPropertyValue(ConfigurationPropertySourcesPropertyResolver.java:97) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:74) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:65) at org.springframework.core.env.AbstractPropertyResolver.getProperty(AbstractPropertyResolver.java:175) at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:610) at org.springframework.cloud.util.PropertyUtils.bootstrapEnabled(PropertyUtils.java:49) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:99) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:77) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) at java.util.ArrayList.forEach(ArrayList.java:1259) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:344) at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) at org.springframework.cloud.context.restart.RestartEndpoint.doRestart(RestartEndpoint.java:144) at org.springframework.cloud.context.restart.RestartEndpoint.safeRestart(RestartEndpoint.java:110) at java.lang.Thread.run(Thread.java:750)
2022-09-21 14:01:12.651 INFO 17436 --- [ Thread-35] o.s.c.context.restart.RestartEndpoint : Could not doRestart: UT015023: This Context has been already destroyed
Process finished with exit code 0`
The restart under
Tomcat
container is successful, but the restart underundertow
failsThis is my logs below:
`2022-09-21 14:00:06.198 INFO 17436 --- [kground-preinit] o.h.validator.internal.util.Version : HV000001: Hibernate Validator 6.2.4.Final
2022-09-21 14:00:06.827 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 24 ms to scan 1 urls, producing 3 keys and 6 values 2022-09-21 14:00:06.852 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 13 ms to scan 1 urls, producing 4 keys and 9 values 2022-09-21 14:00:06.864 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 10 ms to scan 1 urls, producing 3 keys and 10 values 2022-09-21 14:00:06.988 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 122 ms to scan 214 urls, producing 0 keys and 0 values 2022-09-21 14:00:07.000 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 10 ms to scan 1 urls, producing 1 keys and 5 values 2022-09-21 14:00:07.012 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 11 ms to scan 1 urls, producing 1 keys and 7 values 2022-09-21 14:00:07.024 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 10 ms to scan 1 urls, producing 2 keys and 8 values 2022-09-21 14:00:07.141 INFO 17436 --- [ main] org.reflections.Reflections : Reflections took 115 ms to scan 214 urls, producing 0 keys and 0 values 2022-09-21 14:00:07.797 WARN 17436 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[test-file] & group[DEFAULT_GROUP] 2022-09-21 14:00:07.807 WARN 17436 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[test-file.yml] & group[DEFAULT_GROUP] 2022-09-21 14:00:07.817 INFO 17436 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-test-file-dev.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-test-file.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-test-file,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-application-dev.yml,DEFAULT_GROUP'}] 2022-09-21 14:00:07.824 INFO 17436 --- [ main] com.byd.test.file.testFileApplication : The following 1 profile is active: "dev" 2022-09-21 14:00:08.893 INFO 17436 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=8f79de01-2e68-3ca3-a7eb-b13c2fb76c5f 2022-09-21 14:00:09.047 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration' of type [org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.048 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.048 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'loadBalancerClientsDefaultsMappingsProvider' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration$$Lambda$403/15107073] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.050 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'defaultsBindHandlerAdvisor' of type [org.springframework.cloud.commons.config.DefaultsBindHandlerAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.055 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'swagger-com.byd.test.common.swagger.support.SwaggerProperties' of type [com.byd.test.common.swagger.support.SwaggerProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.057 INFO 17436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'SwaggerAutoConfiguration' of type [com.byd.test.common.swagger.config.SwaggerAutoConfiguration$$EnhancerBySpringCGLIB$$56428158] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2022-09-21 14:00:09.217 INFO 17436 --- [ main] io.undertow.servlet : Initializing Spring embedded WebApplicationContext 2022-09-21 14:00:09.218 INFO 17436 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1381 ms 2022-09-21 14:00:09.996 INFO 17436 --- [ main] c.a.c.sentinel.SentinelWebMvcConfigurer : [Sentinel Starter] register SentinelWebInterceptor with urlPatterns: [/**]. 2022-09-21 14:00:10.251 INFO 17436 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 16 endpoint(s) beneath base path '/actuator' INFO: Sentinel log output type is: file INFO: Sentinel log charset is: utf-8 INFO: Sentinel log base directory is: C:\Users\Ja\logs\csp INFO: Sentinel log name use pid is: false INFO: Sentinel log level is: INFO 2022-09-21 14:00:11.172 INFO 17436 --- [ main] io.undertow : starting server: Undertow - 2.2.19.Final 2022-09-21 14:00:11.177 INFO 17436 --- [ main] org.xnio : XNIO version 3.8.7.Final 2022-09-21 14:00:11.181 INFO 17436 --- [ main] org.xnio.nio : XNIO NIO Implementation Version 3.8.7.Final 2022-09-21 14:00:11.205 INFO 17436 --- [ main] org.jboss.threads : JBoss Threads version 3.1.0.Final 2022-09-21 14:00:11.248 INFO 17436 --- [ main] o.s.b.w.e.undertow.UndertowWebServer : Undertow started on port(s) 5002 (http) 2022-09-21 14:00:11.260 INFO 17436 --- [ main] c.a.c.n.registry.NacosServiceRegistry : nacos registry, DEFAULT_GROUP test-file 192.168.10.10:5002 register finished 2022-09-21 14:00:11.474 INFO 17436 --- [ main] com.byd.test.file.testFileApplication : Started testFileApplication in 5.849 seconds (JVM running for 6.401) 2022-09-21 14:00:11.478 INFO 17436 --- [ main] c.a.c.n.refresh.NacosContextRefresher : [Nacos Config] Listening config: dataId=test-file, group=DEFAULT_GROUP 2022-09-21 14:00:11.478 INFO 17436 --- [ main] c.a.c.n.refresh.NacosContextRefresher : [Nacos Config] Listening config: dataId=test-file-dev.yml, group=DEFAULT_GROUP 2022-09-21 14:00:11.479 INFO 17436 --- [ main] c.a.c.n.refresh.NacosContextRefresher : [Nacos Config] Listening config: dataId=test-file.yml, group=DEFAULT_GROUP 2022-09-21 14:00:11.479 INFO 17436 --- [ main] c.a.c.n.refresh.NacosContextRefresher : [Nacos Config] Listening config: dataId=application-dev.yml, group=DEFAULT_GROUP 2022-09-21 14:00:33.348 INFO 17436 --- [ XNIO-1 task-1] io.undertow.servlet : Initializing Spring DispatcherServlet 'dispatcherServlet' 2022-09-21 14:00:33.348 INFO 17436 --- [ XNIO-1 task-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2022-09-21 14:00:33.350 INFO 17436 --- [ XNIO-1 task-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms 2022-09-21 14:01:12.277 INFO 17436 --- [ Thread-35] io.undertow : stopping server: Undertow - 2.2.19.Final 2022-09-21 14:01:12.280 INFO 17436 --- [ Thread-35] io.undertow.servlet : Destroying Spring FrameworkServlet 'dispatcherServlet' 2022-09-21 14:01:12.291 INFO 17436 --- [ Thread-35] c.a.c.n.registry.NacosServiceRegistry : De-registering from Nacos Server now... 2022-09-21 14:01:12.299 INFO 17436 --- [ Thread-35] c.a.c.n.registry.NacosServiceRegistry : De-registration finished. 2022-09-21 14:01:12.651 ERROR 17436 --- [ Thread-35] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: UT015023: This Context has been already destroyed at io.undertow.servlet.spec.ServletContextImpl.getDeploymentInfo(ServletContextImpl.java:211) at io.undertow.servlet.spec.ServletContextImpl.getInitParameter(ServletContextImpl.java:444) at org.springframework.web.context.support.ServletContextPropertySource.getProperty(ServletContextPropertySource.java:47) at org.springframework.web.context.support.ServletContextPropertySource.getProperty(ServletContextPropertySource.java:33) at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver$DefaultResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:123) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.findPropertyValue(ConfigurationPropertySourcesPropertyResolver.java:97) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:74) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:65) at org.springframework.core.env.AbstractPropertyResolver.getProperty(AbstractPropertyResolver.java:175) at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:610) at org.springframework.cloud.util.PropertyUtils.bootstrapEnabled(PropertyUtils.java:49) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:99) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:77) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) at java.util.ArrayList.forEach(ArrayList.java:1259) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:344) at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) at org.springframework.cloud.context.restart.RestartEndpoint.doRestart(RestartEndpoint.java:144) at org.springframework.cloud.context.restart.RestartEndpoint.safeRestart(RestartEndpoint.java:110) at java.lang.Thread.run(Thread.java:750)
2022-09-21 14:01:12.651 INFO 17436 --- [ Thread-35] o.s.c.context.restart.RestartEndpoint : Could not doRestart: UT015023: This Context has been already destroyed
Process finished with exit code 0`
But, I tested using undertow is ok, specific pom.xml
and dependencies
like above. You can try it again according to them.
这个问题很久以前讨论过,还跟IDE有关,例如,在Eclipse是OK的,在Idea里却有问题,还有,脱离了IDE环境,通过Java -jar方式启动就没问题,还有跟JDK版本也有关系。
You can try it according to above comment. I didn't reproduce the problem and close first.