微服务停止的时候报错

Blade 未结 1 594
nbullet
nbullet 剑圣 2023-02-17 17:29

一、该问题的重现步骤是什么?

1. 启动一个任意一个微服务

2. 正常注册到nacos

3.停止服务


二、你期待的结果是什么?实际看到的又是什么?

期待正常停止,实际报错:java.lang.IllegalStateException: UT015023: This Context has been already destroyed

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

Bladex 3.0.1.Release

四、请提供详细的错误堆栈信息,这很重要。

2023-02-17 17:28:10.678  INFO 23128 --- [ionShutdownHook] io.undertow                              : stopping server: Undertow - 2.2.18.Final

2023-02-17 17:28:10.684  INFO 23128 --- [ionShutdownHook] io.undertow.servlet                      : Destroying Spring FrameworkServlet 'dispatcherServlet'

2023-02-17 17:28:10.686 ERROR 23128 --- [ionShutdownHook] c.a.cloud.nacos.discovery.NacosWatch     : namingService unsubscribe failed, properties:NacosDiscoveryProperties{serverAddr='10.23.2.2:8848', username='', password='', endpoint='', namespace='', watchDelay=30000, logName='', service='cscsp-bss', weight=1.0, clusterName='DEFAULT', group='DEFAULT_GROUP', namingLoadCacheAtStart='false', metadata={preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip='10.23.100.53', networkInterface='', port=8106, secure=false, accessKey='', secretKey='', heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null, instanceEnabled=true, ephemeral=true, failureToleranceEnabled=false}, ipDeleteTimeout=null, failFast=true}


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.getInitParameterNames(ServletContextImpl.java:449)

at org.springframework.web.context.support.ServletContextPropertySource.getPropertyNames(ServletContextPropertySource.java:41)

at com.alibaba.spring.util.PropertySourcesUtils.getPropertyNames(PropertySourcesUtils.java:130)

at com.alibaba.spring.util.PropertySourcesUtils.getSubProperties(PropertySourcesUtils.java:103)

at com.alibaba.spring.util.PropertySourcesUtils.getSubProperties(PropertySourcesUtils.java:57)

at com.alibaba.cloud.nacos.NacosDiscoveryProperties.enrichNacosDiscoveryProperties(NacosDiscoveryProperties.java:657)

at com.alibaba.cloud.nacos.NacosDiscoveryProperties.getNacosProperties(NacosDiscoveryProperties.java:651)

at com.alibaba.cloud.nacos.discovery.NacosWatch.stop(NacosWatch.java:175)

at com.alibaba.cloud.nacos.discovery.NacosWatch.stop(NacosWatch.java:107)

at org.springframework.context.support.DefaultLifecycleProcessor.doStop(DefaultLifecycleProcessor.java:234)

at org.springframework.context.support.DefaultLifecycleProcessor.access$300(DefaultLifecycleProcessor.java:54)

at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(DefaultLifecycleProcessor.java:373)

at org.springframework.context.support.DefaultLifecycleProcessor.stopBeans(DefaultLifecycleProcessor.java:206)

at org.springframework.context.support.DefaultLifecycleProcessor.onClose(DefaultLifecycleProcessor.java:129)

at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1067)

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:174)

at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1021)

at org.springframework.boot.SpringApplicationShutdownHook.closeAndWait(SpringApplicationShutdownHook.java:145)

at java.lang.Iterable.forEach(Iterable.java:75)

at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:114)

at java.lang.Thread.run(Thread.java:750)


2023-02-17 17:28:10.691  INFO 23128 --- [ionShutdownHook] c.a.c.n.registry.NacosServiceRegistry    : De-registering from Nacos Server now...

2023-02-17 17:28:10.691  WARN 23128 --- [ionShutdownHook] .s.c.a.CommonAnnotationBeanPostProcessor : Destroy method on bean with name 'nacosAutoServiceRegistration' threw an exception: java.lang.IllegalStateException: UT015023: This Context has been already destroyed

2023-02-17 17:28:11.176  INFO 23128 --- [ionShutdownHook] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closing ...

2023-02-17 17:28:11.187  INFO 23128 --- [ionShutdownHook] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closed


Process finished with exit code 130

五、若有更多详细信息,请在下面提供。

1条回答
  • 2023-02-21 14:46

    停掉服务后,nacos监听不到服务了,注册会失败,所以会有这个错误 [namingService unsubscribe failed] 再接着就是提示上下文已被销毁,这是正常的。

    0 讨论(0)
提交回复