Why does Spring Dev Tools keep restarting the Spring Boot application on IntelliJ even though nothing is being changed?
Why does Spring Dev Tools keep restarting the Spring Boot application on IntelliJ even though nothing is being changed?
I just started a simple spring boot application with the following dependencies: spring-boot-starter-thymeleaf
, spring-boot-starter-web
, spring-boot-devtools
, and spring-boot-starter-test
.
spring-boot-starter-thymeleaf
spring-boot-starter-web
spring-boot-devtools
spring-boot-starter-test
I'm using intellij with Build project automatically
checked and compiler.automake.allow.when.app.running
set to true.
Build project automatically
compiler.automake.allow.when.app.running
Here are the logs:
Connected to the target VM, address: '127.0.0.1:39495', transport: 'socket'
21:18:00.410 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart :
21:18:00.413 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-actuator/target/classes/, /spring-boot-devtools/target/classes/, /spring-boot/target/classes/, /spring-boot-starter-[w-]+/, /spring-boot-autoconfigure/target/classes/, /spring-boot-starter/target/classes/]
21:18:00.413 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/home/someuser/development/workspace/myapp/target/classes/]
. ____ _ __ _ _
/\ / ___'_ __ _ _(_)_ __ __ _
( ( )___ | '_ | '_| | '_ / _` |
\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |___, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.4.RELEASE)
2018-08-11 21:18:00.679 INFO 5202 --- [ restartedMain] c.g.s.MyappApplication : Starting MyappApplication on new-host-3 with PID 5202 (/home/someuser/development/workspace/myapp/target/classes started by someuser in /home/someuser/development/workspace/myapp)
2018-08-11 21:18:00.680 INFO 5202 --- [ restartedMain] c.g.s.MyappApplication : No active profile set, falling back to default profiles: default
2018-08-11 21:18:00.721 INFO 5202 --- [ restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@26b6db0c: startup date [Sat Aug 11 21:18:00 EDT 2018]; root of context hierarchy
2018-08-11 21:18:01.729 INFO 5202 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-08-11 21:18:01.752 INFO 5202 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-08-11 21:18:01.752 INFO 5202 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.32
2018-08-11 21:18:01.757 INFO 5202 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
2018-08-11 21:18:01.823 INFO 5202 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-08-11 21:18:01.823 INFO 5202 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1107 ms
2018-08-11 21:18:01.894 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-08-11 21:18:01.899 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-08-11 21:18:01.899 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-08-11 21:18:01.899 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-08-11 21:18:01.899 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-08-11 21:18:02.046 INFO 5202 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-11 21:18:02.189 INFO 5202 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@26b6db0c: startup date [Sat Aug 11 21:18:00 EDT 2018]; root of context hierarchy
2018-08-11 21:18:02.235 INFO 5202 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "[/error],produces=[text/html]" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-08-11 21:18:02.235 INFO 5202 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "[/error]" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-08-11 21:18:02.256 INFO 5202 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-11 21:18:02.256 INFO 5202 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-11 21:18:02.349 INFO 5202 --- [ restartedMain] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index
2018-08-11 21:18:02.448 INFO 5202 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2018-08-11 21:18:02.475 INFO 5202 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-08-11 21:18:02.513 INFO 5202 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-08-11 21:18:02.517 INFO 5202 --- [ restartedMain] c.g.s.MyappApplication : Started MyappApplication in 2.092 seconds (JVM running for 2.702)
2018-08-11 21:18:04.243 INFO 5202 --- [ Thread-10] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@26b6db0c: startup date [Sat Aug 11 21:18:00 EDT 2018]; root of context hierarchy
2018-08-11 21:18:04.245 INFO 5202 --- [ Thread-10] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
. ____ _ __ _ _
/\ / ___'_ __ _ _(_)_ __ __ _
( ( )___ | '_ | '_| | '_ / _` |
\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |___, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.4.RELEASE)
2018-08-11 21:18:04.435 INFO 5202 --- [ restartedMain] c.g.s.MyappApplication : Starting MyappApplication on new-host-3 with PID 5202 (/home/someuser/development/workspace/myapp/target/classes started by someuser in /home/someuser/development/workspace/myapp)
2018-08-11 21:18:04.435 INFO 5202 --- [ restartedMain] c.g.s.MyappApplication : No active profile set, falling back to default profiles: default
2018-08-11 21:18:04.437 INFO 5202 --- [ restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@75139be5: startup date [Sat Aug 11 21:18:04 EDT 2018]; root of context hierarchy
2018-08-11 21:18:04.774 INFO 5202 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-08-11 21:18:04.775 INFO 5202 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-08-11 21:18:04.776 INFO 5202 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.32
2018-08-11 21:18:04.782 INFO 5202 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-08-11 21:18:04.782 INFO 5202 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 345 ms
2018-08-11 21:18:04.791 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-08-11 21:18:04.791 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-08-11 21:18:04.792 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-08-11 21:18:04.792 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-08-11 21:18:04.792 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-08-11 21:18:04.816 INFO 5202 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-11 21:18:04.848 INFO 5202 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@75139be5: startup date [Sat Aug 11 21:18:04 EDT 2018]; root of context hierarchy
2018-08-11 21:18:04.859 INFO 5202 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "[/error],produces=[text/html]" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-08-11 21:18:04.860 INFO 5202 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "[/error]" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-08-11 21:18:04.868 INFO 5202 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-11 21:18:04.868 INFO 5202 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-11 21:18:04.895 INFO 5202 --- [ restartedMain] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index
2018-08-11 21:18:04.915 INFO 5202 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2018-08-11 21:18:04.937 INFO 5202 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-08-11 21:18:04.962 INFO 5202 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-08-11 21:18:04.963 INFO 5202 --- [ restartedMain] c.g.s.MyappApplication : Started MyappApplication in 0.545 seconds (JVM running for 5.149)
2018-08-11 21:18:04.966 INFO 5202 --- [ restartedMain] .ConditionEvaluationDeltaLoggingListener : Condition evaluation unchanged
2018-08-11 21:18:07.320 INFO 5202 --- [ Thread-19] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@75139be5: startup date [Sat Aug 11 21:18:04 EDT 2018]; root of context hierarchy
2018-08-11 21:18:07.322 INFO 5202 --- [ Thread-19] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
. ____ _ __ _ _
/\ / ___'_ __ _ _(_)_ __ __ _
( ( )___ | '_ | '_| | '_ / _` |
\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |___, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.4.RELEASE)
2018-08-11 21:18:07.551 INFO 5202 --- [ restartedMain] c.g.s.MyappApplication : Starting MyappApplication on new-host-3 with PID 5202 (/home/someuser/development/workspace/myapp/target/classes started by someuser in /home/someuser/development/workspace/myapp)
2018-08-11 21:18:07.552 INFO 5202 --- [ restartedMain] c.g.s.MyappApplication : No active profile set, falling back to default profiles: default
2018-08-11 21:18:07.555 INFO 5202 --- [ restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2ab57ff: startup date [Sat Aug 11 21:18:07 EDT 2018]; root of context hierarchy
2018-08-11 21:18:07.829 INFO 5202 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-08-11 21:18:07.830 INFO 5202 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-08-11 21:18:07.830 INFO 5202 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.32
2018-08-11 21:18:07.835 INFO 5202 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-08-11 21:18:07.836 INFO 5202 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 281 ms
2018-08-11 21:18:07.847 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-08-11 21:18:07.847 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-08-11 21:18:07.847 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-08-11 21:18:07.848 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-08-11 21:18:07.848 INFO 5202 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-08-11 21:18:07.874 INFO 5202 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-11 21:18:07.902 INFO 5202 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2ab57ff: startup date [Sat Aug 11 21:18:07 EDT 2018]; root of context hierarchy
2018-08-11 21:18:07.910 INFO 5202 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "[/error],produces=[text/html]" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-08-11 21:18:07.911 INFO 5202 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "[/error]" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-08-11 21:18:07.916 INFO 5202 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-11 21:18:07.916 INFO 5202 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-11 21:18:07.934 INFO 5202 --- [ restartedMain] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index
2018-08-11 21:18:07.951 INFO 5202 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2018-08-11 21:18:07.963 INFO 5202 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-08-11 21:18:07.971 INFO 5202 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-08-11 21:18:07.972 INFO 5202 --- [ restartedMain] c.g.s.MyappApplication : Started MyappApplication in 0.46 seconds (JVM running for 8.157)
2018-08-11 21:18:07.973 INFO 5202 --- [ restartedMain] .ConditionEvaluationDeltaLoggingListener : Condition evaluation unchanged
2018-08-11 21:18:10.356 INFO 5202 --- [ Thread-25] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2ab57ff: startup date [Sat Aug 11 21:18:07 EDT 2018]; root of context hierarchy
2018-08-11 21:18:10.358 INFO 5202 --- [ Thread-25] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
As you can see, it just keeps restarting over and over again. I've taken a look at this question, but the solution did not help me. I cannot find any file that's being constantly written.
Additionally, I have a much more complication/bigger Spring Boot project (which is actually in prod) and that works perfectly fine. As in, when I run that application in the same intellij version, it does not restart constantly.
This means that there is something funky going on with my newly created project, but I'm completely stumped.
0
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Have you tried to run any File Monitor utility to check write actions?
– y.bedrov
Aug 13 '18 at 9:24