Java SpringBoot应用程序始终保持重新启动(重新启动循环)-spring.devtools
我有一个带有嵌入式tomcat的spring boot应用程序,如果类路径中发生了变化,可以使用spring boot devtools重新启动应用程序 我的IDE是Spring工具套件,我切换了“自动构建”,因为我认为这可能会改变后台的文件,从而触发重启 我的问题是,在tomcat和应用程序ist启动后,它会立即重新启动无限循环中的所有内容:Java SpringBoot应用程序始终保持重新启动(重新启动循环)-spring.devtools,java,spring-boot,Java,Spring Boot,我有一个带有嵌入式tomcat的spring boot应用程序,如果类路径中发生了变化,可以使用spring boot devtools重新启动应用程序 我的IDE是Spring工具套件,我切换了“自动构建”,因为我认为这可能会改变后台的文件,从而触发重启 我的问题是,在tomcat和应用程序ist启动后,它会立即重新启动无限循环中的所有内容: 2017-08-22 10:24:04.309 INFO 9772 --- [ restartedMain] s.b.c.e.t.TomcatEmb
2017-08-22 10:24:04.309 INFO 9772 --- [ restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8055 (http)
2017-08-22 10:24:04.415 DEBUG 9772 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Creating new Restarter for thread Thread[main,5,main]
2017-08-22 10:24:04.417 DEBUG 9772 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Immediately restarting application
2017-08-22 10:24:04.418 DEBUG 9772 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@558f3be6
2017-08-22 10:24:04.419 DEBUG 9772 --- [ restartedMain] o.s.boot.devtools.restart.Restarter : Starting application test.web.MyApplication with URLs
2017-08-22 10:24:04.421 INFO 9772 --- [ restartedMain] test.web.MyApplication : Started MyApplication in 22.347 seconds (JVM running for 24.103)
2017-08-22 10:24:05.524 DEBUG 9772 --- [ File Watcher] o.s.boot.devtools.restart.Restarter : Restarting application
2017-08-22 10:24:05.527 DEBUG 9772 --- [ Thread-9] o.s.boot.devtools.restart.Restarter : Stopping application
2017-08-22 10:24:05.527 INFO 9772 --- [ Thread-9] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@68f499a9: startup date [Tue Aug 22 10:23:43 CEST 2017]; root of context hierarchy
2017-08-22 10:24:05.529 INFO 9772 --- [ Thread-9] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2017-08-22 10:24:05.537 INFO 9772 --- [ Thread-9] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2017-08-22 10:24:05.539 INFO 9772 --- [ Thread-9] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000227: Running hbm2ddl schema export
2017-08-22 10:24:05.567 INFO 9772 --- [ Thread-9] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000230: Schema export complete
2017-08-22 10:24:05.864 INFO 9772 --- [ost-startStop-2] org.apache.wicket.Application : [wicket-filter] destroy: DevUtils DebugBar Initializer
...
2017-08-22 10:44:04.309 INFO 9772 --- [ restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8055 (http)
...
2017-08-22 10:44:04.421 INFO 9772 --- [ restartedMain] test.web.MyApplication : Started MyApplication in 22.347 seconds (JVM running for 24.103)
2017-08-22 10:44:05.527 DEBUG 9772 --- [ Thread-9] o.s.boot.devtools.restart.Restarter : Stopping application
解决方法:我知道使用spring.devtools.restart.enabled=false
可以停止此行为,但如果确实需要,我当然希望重新启动
问题:
- 如何找出触发重启的文件更改
- 有人有类似的问题吗
spring:
devtools:
restart:
exclude: logs/**
如果你使用的是普通的属性文件,它是一样的,但是中间有(.)个点。另请参阅以获取参考。我在application.properties中添加了,然后它工作正常。TQ
spring.devtools.restart.additional-exclude=logs/**
在IntelliJ IDE中
->
选择Spring Boot服务项目(在左侧面板)->
设置运行应用程序更新策略:
- 关于“更新”操作:什么都不做
- 关于“帧停用”:什么也不做