1. 程式人生 > >IntelliJ idea中Springboot啟動不了 Process finished with exit code 0

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>