springcloud 版本 idea 修改java代码f9 热加载,微服务加载失败,循环重启

Blade 已结 1 1227
shunc
shunc 剑童 2021-11-19 15:50

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

  1. spring cloud版本代码;

  2. idea 2019 导入代码

  3. 添加热加载功能,

  4. 修改代码后,微服务重启;


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

  修改代码后,正常热加载,微服务不需要重启;


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

  spring blade,spring cloud win10


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

 Generating unique operation named: detailUsingGET_4
2021-11-19 15:47:38.034  INFO 26372 --- [  restartedMain] org.springblade.EtlApplication           : Started EtlApplication in 5.02 seconds (JVM running for 665.443)
2021-11-19 15:47:38.978  INFO 26372 --- [     Thread-118] io.undertow                              : stopping server: Undertow - 2.2.8.Final
2021-11-19 15:47:38.983 ERROR 26372 --- [     Thread-118] c.a.cloud.nacos.discovery.NacosWatch     : namingService unsubscribe failed, properties:NacosDiscoveryProperties{serverAddr='127.0.0.1:8848', endpoint='', namespace='', watchDelay=30000, logName='', service='blade-user', weight=1.0, clusterName='DEFAULT', group='DEFAULT_GROUP', namingLoadCacheAtStart='false', metadata={preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip='11.153.52.17', networkInterface='', port=9101, secure=false, accessKey='', secretKey='', heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null}

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:616)
	at com.alibaba.cloud.nacos.NacosDiscoveryProperties.getNacosProperties(NacosDiscoveryProperties.java:610)
	at com.alibaba.cloud.nacos.discovery.NacosWatch.stop(NacosWatch.java:165)
	at com.alibaba.cloud.nacos.discovery.NacosWatch.stop(NacosWatch.java:97)
	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:172)
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1021)
	at org.springframework.boot.builder.ParentContextCloserApplicationListener$ContextCloserListener.onApplicationEvent(ParentContextCloserApplicationListener.java:94)
	at org.springframework.boot.builder.ParentContextCloserApplicationListener$ContextCloserListener.onApplicationEvent(ParentContextCloserApplicationListener.java:82)
	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.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378)
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1058)
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1021)
	at org.springframework.boot.devtools.restart.Restarter.stop(Restarter.java:309)
	at org.springframework.boot.devtools.restart.Restarter.lambda$restart$1(Restarter.java:251)
	at org.springframework.boot.devtools.restart.Restarter$LeakSafeThread.run(Restarter.java:629)

2021-11-19 15:47:38.984  INFO 26372 --- [     Thread-118] c.a.c.n.registry.NacosServiceRegistry    : De-registering from Nacos Server now...
2021-11-19 15:47:38.984  WARN 26372 --- [     Thread-118] .s.c.a.CommonAnnotationBeanPostProcessor : Destroy method on bean with name 'nacosAutoServiceRegistration' threw an exception: java.lang.IllegalStateException: UT015023: This Context has been already destroyed
2021-11-19 15:47:39.595  INFO 26372 --- [     Thread-118] com.alibaba.druid.pool.DruidDataSource   : {dataSource-6} closing ...
2021-11-19 15:47:39.597  INFO 26372 --- [     Thread-118] com.alibaba.druid.pool.DruidDataSource   : {dataSource-6} closed
----启动中,读取到的环境变量:[dev],jar地址:[/D:/code/etl2.0/user-back/blade-service/blade-user/target/classes/]----
 _____               _                 ______  _             _
/  ___|             (_)                | ___ \| |           | |
\ `--.  _ __   _ __  _  _ __    __ _   | |_/ /| |  __ _   __| |  ___
 `--. \| '_ \ | '__|| || '_ \  / _` |  | ___ \| | / _` | / _` | / _ \
/\__/ /| |_) || |   | || | | || (_| |  | |_/ /| || (_| || (_| ||  __/
\____/ | .__/ |_|   |_||_| |_| \__, |  \____/ |_| \__,_| \__,_| \___|
       | |                      __/ |
       |_|                     |___/

:: SpringBlade :: blade-user:dev :: Running SpringBoot 2.5.2 :: 

2021-11-19 15:47:40.328  WARN 26372 --- [  restartedMain] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[blade] & group[DEFAULT_GROUP]
2021-11-19 15:47:40.336  INFO 26372 --- [  restartedMain] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-blade-dev.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-blade.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-blade,DEFAULT_GROUP'}]
2021-11-19 15:47:40.343  INFO 26372 --- [  restartedMain] org.springblade.EtlApplication           : The following profiles are active: dev


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

1条回答
  •  zhx1994
    zhx1994 (最佳回答者)
    2021-11-19 17:25

    用JRebel插件

    0 讨论(1)
提交回复