欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

java - IntelliJ idea中Springboot启动不了 Process finished with exit code 0

程序员文章站 2022-05-08 22:36:39
...

在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>




相关标签: springboot idea