猿问

为什么Springboot 初始化模板 启动自动关闭没有报错信息


  .   ____          _            __ _ _

 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )

  '  |____| .__|_| |_|_| |_\__, | / / / /

 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::        (v1.4.5.RELEASE)


2017-04-13 09:30:24.619  INFO 5132 --- [           main] com.example.DemoApplication              : Starting DemoApplication on teacher023 with PID 5132 (C:\Users\Administrator\IdeaProjects\myth\demo\target\classes started by Administrator in C:\Users\Administrator\IdeaProjects\myth)

2017-04-13 09:30:24.619  INFO 5132 --- [           main] com.example.DemoApplication              : No active profile set, falling back to default profiles: default

2017-04-13 09:30:24.681  INFO 5132 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@3b69e7d1: startup date [Thu Apr 13 09:30:24 GMT+08:00 2017]; root of context hierarchy

2017-04-13 09:30:25.742  INFO 5132 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup

2017-04-13 09:30:25.758  INFO 5132 --- [           main] com.example.DemoApplication              : Started DemoApplication in 1.607 seconds (JVM running for 1.979)

2017-04-13 09:30:25.758  INFO 5132 --- [       Thread-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@3b69e7d1: startup date [Thu Apr 13 09:30:24 GMT+08:00 2017]; root of context hierarchy

2017-04-13 09:30:25.758  INFO 5132 --- [       Thread-1] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown


Process finished with exit code 0


mythos_
浏览 12914回答 3
3回答

rookie2maven

没有引入spring-boot-starter-web包,此时的程序没有运行在服务器上,跟普通的java程序一样。

慕标0118672

 <dependency>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-tomcat</artifactId>         <scope>provided</scope>     </dependency>     <scope>provided</scope>删除就好了

光之心MAX

可能有些启动时静态实现的功能初始化出错,导致启动失败,自动关闭。
随时随地看视频慕课网APP

相关分类

Java
我要回答