2021-02-06 18:40:41.873 [fileListener_2] ERROR io.seata.config.FileConfiguration - fileListener execute error:org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
at org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:1092) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1125) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.get(SpringBootConfigurationProvider.java:93) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.access$100(SpringBootConfigurationProvider.java:43) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider$1.intercept(SpringBootConfigurationProvider.java:56) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.config.FileConfiguration$$EnhancerByCGLIB$$862af1eb.getConfig(<generated>) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.FileConfiguration$FileListener.onChangeEvent(FileConfiguration.java:311) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.ConfigurationChangeListener.lambda$onProcessEvent$0(ConfigurationChangeListener.java:62) ~[seata-all-1.1.0.jar:1.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run(FutureTask.java) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_271]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.45.Final.jar:4.1.45.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_271]
新值
1、使用 idea
2、工程使用 nacos(1.4.0) 做配置中心
3、seata(spring-cloud-starter-alibaba-seata 2.2.3.RELEASE) 使用 db 模式,seata 数据库在本地电脑 mysql 上
4、配置中心有测试、开发两个配置,测试环境的业务数据库在阿里云,开发环境的业务数据库在本地电脑
5、使用 devtools 自动热启动
6、框架版本是 spring boot(2.2.5.RELEASE)、spring cloud(Hoxton.SR3)、spring cloud aibaba(2.2.1.RELEASE)
2021-02-06 18:40:41.873 [fileListener_2] ERROR io.seata.config.FileConfiguration - fileListener execute error:org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
at org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:1092) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1125) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.get(SpringBootConfigurationProvider.java:93) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.access$100(SpringBootConfigurationProvider.java:43) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider$1.intercept(SpringBootConfigurationProvider.java:56) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.config.FileConfiguration$$EnhancerByCGLIB$$862af1eb.getConfig(<generated>) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.FileConfiguration$FileListener.onChangeEvent(FileConfiguration.java:311) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.ConfigurationChangeListener.lambda$onProcessEvent$0(ConfigurationChangeListener.java:62) ~[seata-all-1.1.0.jar:1.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run(FutureTask.java) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_271]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.45.Final.jar:4.1.45.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_271]
2021-02-06 18:40:41.873 [fileListener_2] ERROR io.seata.config.FileConfiguration - fileListener execute error:org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
at org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:1092) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1125) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.get(SpringBootConfigurationProvider.java:93) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.access$100(SpringBootConfigurationProvider.java:43) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider$1.intercept(SpringBootConfigurationProvider.java:56) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.config.FileConfiguration$$EnhancerByCGLIB$$862af1eb.getConfig(<generated>) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.FileConfiguration$FileListener.onChangeEvent(FileConfiguration.java:311) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.ConfigurationChangeListener.lambda$onProcessEvent$0(ConfigurationChangeListener.java:62) ~[seata-all-1.1.0.jar:1.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run(FutureTask.java) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_271]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.45.Final.jar:4.1.45.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_271]
新值
1、使用 idea
2、工程使用 nacos(1.4.0) 做配置中心
3、seata(spring-cloud-starter-alibaba-seata 2.2.3.RELEASE) 使用 db 模式,seata 数据库在本地电脑 mysql 上
4、配置中心有测试、开发两个配置,测试环境的业务数据库在阿里云,开发环境的业务数据库在本地电脑
5、使用 devtools 自动热启动
6、框架版本是 spring boot(2.2.5.RELEASE)、spring cloud(Hoxton.SR3)、spring cloud aibaba(2.2.1.RELEASE)
`2021-02-06 18:40:41.873 [fileListener_2] ERROR io.seata.config.FileConfiguration - fileListener execute error:org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
at org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:1092) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1125) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.get(SpringBootConfigurationProvider.java:93) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.access$100(SpringBootConfigurationProvider.java:43) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider$1.intercept(SpringBootConfigurationProvider.java:56) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.config.FileConfiguration$$EnhancerByCGLIB$$862af1eb.getConfig(<generated>) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.FileConfiguration$FileListener.onChangeEvent(FileConfiguration.java:311) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.ConfigurationChangeListener.lambda$onProcessEvent$0(ConfigurationChangeListener.java:62) ~[seata-all-1.1.0.jar:1.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run(FutureTask.java) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_271]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.45.Final.jar:4.1.45.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_271]`
`2021-02-06 18:40:41.873 [fileListener_2] ERROR io.seata.config.FileConfiguration - fileListener execute error:org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
at org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:1092) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1125) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.get(SpringBootConfigurationProvider.java:93) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.access$100(SpringBootConfigurationProvider.java:43) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider$1.intercept(SpringBootConfigurationProvider.java:56) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.config.FileConfiguration$$EnhancerByCGLIB$$862af1eb.getConfig(<generated>) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.FileConfiguration$FileListener.onChangeEvent(FileConfiguration.java:311) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.ConfigurationChangeListener.lambda$onProcessEvent$0(ConfigurationChangeListener.java:62) ~[seata-all-1.1.0.jar:1.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run(FutureTask.java) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_271]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.45.Final.jar:4.1.45.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_271]`
新值
1、使用 idea
2、工程使用 nacos(1.4.0) 做配置中心
3、seata(spring-cloud-starter-alibaba-seata 2.2.3.RELEASE) 使用 db 模式,seata 数据库在本地电脑 mysql 上
5、使用 devtools 自动热启动
6、框架版本是 spring boot(2.2.5.RELEASE)、spring cloud(Hoxton.SR3)、spring cloud aibaba(2.2.1.RELEASE)
问题来了:
一旦触发 devtools 自动重启时,seata 就一直抛出异常
异常内容:
`2021-02-06 18:40:41.873 [fileListener_2] ERROR io.seata.config.FileConfiguration - fileListener execute error:org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2fd76e3a has been closed already
at org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:1092) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1125) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.get(SpringBootConfigurationProvider.java:93) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.access$100(SpringBootConfigurationProvider.java:43) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider$1.intercept(SpringBootConfigurationProvider.java:56) ~[seata-spring-boot-starter-1.1.0.jar:?]
at io.seata.config.FileConfiguration$$EnhancerByCGLIB$$862af1eb.getConfig(<generated>) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.FileConfiguration$FileListener.onChangeEvent(FileConfiguration.java:311) ~[seata-all-1.1.0.jar:1.1.0]
at io.seata.config.ConfigurationChangeListener.lambda$onProcessEvent$0(ConfigurationChangeListener.java:62) ~[seata-all-1.1.0.jar:1.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [?:1.8.0_271]
at java.util.concurrent.FutureTask.run(FutureTask.java) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_271]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_271]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.45.Final.jar:4.1.45.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_271]`