java - IntelliJ idea中Springboot启动不了 Process finished with exit code 0
在idea中编写spring boot程序出现如下错误
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.10.RELEASE)
2018-02-04 12:17:55.506 INFO 5028 --- [ main] com.gd.ActivemqApplication : Starting ActivemqApplication on LAPTOP-DBHVMBIK with PID 5028 (F:\SpringBootT\springbootdemo\activemq\target\classes started by 郭 in F:\SpringBootT\springbootdemo\activemq)
2018-02-04 12:17:55.531 INFO 5028 --- [ main] com.gd.ActivemqApplication : No active profile set, falling back to default profiles: default
2018-02-04 12:17:55.865 INFO 5028 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]1d7acb34: startup date [Sun Feb 04 12:17:55 CST 2018]; root of context hierarchy
2018-02-04 12:17:57.855 INFO 5028 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-02-04 12:17:57.886 INFO 5028 --- [ main] com.gd.ActivemqApplication : Started ActivemqApplication in 3.135 seconds (JVM running for 3.725)
2018-02-04 12:17:57.906 INFO 5028 --- [ Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.spring[email protected]1d7acb34: startup date [Sun Feb 04 12:17:55 CST 2018]; root of context hierarchy
2018-02-04 12:17:57.908 INFO 5028 --- [ Thread-2] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
Process finished with exit code 0
问题:
需要在应用程序中包含一个web容器
解决方法:
可以引入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
上一篇: IDEA debug多线程调试
下一篇: 如何煲好一锅汤?这煲汤误区你中招了吗?