我刚刚启动了一个简单的Spring Boot应用程序,该应用程序具有以下依赖性:spring-boot-starter-thymeleaf
,spring-boot-starter-web
,spring-boot-devtools
和spring-boot-starter-test
。
我正在使用intellij,并选中Build project automatically
并将compiler.automake.allow.when.app.running
设置为true。
以下是日志:
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
如您所见,它只是不断地反复重启。我看过这个question,但是解决方案并没有帮助我。我找不到正在不断写入的任何文件。
此外,我还有一个更复杂/更大的Spring Boot项目(实际上在产品中),并且工作得很好。与之类似,当我以相同的intellij版本运行该应用程序时,它不会不断重启。
这意味着我新创建的项目中发生了一些时髦的事情,但是我完全迷住了。