问题:从start.spring.io导出的入门demo,引入到sts中并不好用下面是错误日志。
main] i.a.hellospringboot.CourseApiApp : Starting CourseApiApp on johndoe-MacBook-Pro.local with PID 22730 (/Users/johndoe/Documents/workspace-sts-3.8.4.RELEASE/com.myapp.hello-spring-boot/target/classes started by john doe in /Users/johndoe/Documents/workspace-sts-3.8.4.RELEASE/com.myapp.hello-spring-boot)
2017-05-02 21:28:29.454 INFO 22730 --- [ main] i.a.hellospringboot.CourseApiApp : No active profile set, falling back to default profiles: default
2017-05-02 21:28:29.552 INFO 22730 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@5427c60c: startup date [Tue May 02 21:28:29 CDT 2017]; root of context hierarchy
2017-05-02 21:28:30.838 INFO 22730 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2017-05-02 21:28:30.917 INFO 22730 --- [ main] i.a.hellospringboot.CourseApiApp : Started CourseApiApp in 2.122 seconds (JVM running for 2.614)
2017-05-02 21:28:30.919 INFO 22730 --- [ Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@5427c60c: startup date [Tue May 02 21:28:29 CDT 2017]; root of context hierarchy
2017-05-02 21:28:30.920 INFO 22730 --- [ Thread-2] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
解决方案:
1.添加web依赖
2.添加tomcat依赖
3.清理maven仓库中的冲突的依赖
mvn dependency:purge-local-repository