我使用Web和Thymeleaf依赖项创建了一个新的Spring Web项目, 使用Maven和Spring Boot 2.0.1版 但是,如果我尝试运行它,它不会在localhost端口上启动,并使用以下日志消息关闭自己:
2018-04-17 22:44:30.089 INFO 8904 --- [ main] c.s.s.SpringJokesAppApplication : No active profile set, falling back to default profiles: default
2018-04-17 22:44:31.055 INFO 8904 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@3c72f59f: startup date [Tue Apr 17 22:44:30 CEST 2018]; root of context hierarchy
2018-04-17 22:44:35.418 WARN 8904 --- [ main] ion$DefaultTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
2018-04-17 22:44:35.602 INFO 8904 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-04-17 22:44:35.638 INFO 8904 --- [ main] c.s.s.SpringJokesAppApplication : Started SpringJokesAppApplication in 10.542 seconds (JVM running for 22.976)
2018-04-17 22:44:35.646 INFO 8904 --- [ Thread-25] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@3c72f59f: startup date [Tue Apr 17 22:44:30 CEST 2018]; root of context hierarchy
2018-04-17 22:44:35.650 INFO 8904 --- [ Thread-25] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
Process finished with exit code 0
当我使用Spring Boot版本2.0.0创建另一个项目时它工作,但从那时起它升级到2.0.1它不在localhost上运行。我认为Tomcat存在问题,但我不知道为什么。
答案 0 :(得分:0)
项目运行正常,尝试从.m2文件夹中删除org.springframwork.boot
答案 1 :(得分:0)
我解决了它,删除了整个.m2 \ repository文件夹,然后重新导入所有maven项目。 (Maven - 更新)感谢您的帮助!