23.1 SpringApplication spring boot 启动

springApplication  提供启动类的main方法,在许多情况下,您可以将其委托给静态spring应用程序。运行方法:

public static void main(String[] args) throws Exception {
    //设置 热启动不生效 也可以在 资源文件中配置spring.devtools.restart.enabled
    //   System.setProperty("spring.devtools.restart.enabled", "false");
    //SpringApplication.run(Example.class, args);


    SpringApplication application = new SpringApplication(Example.class);
           /*
            * Banner.Mode.OFF:关闭;
            * Banner.Mode.CONSOLE:控制台输出,默认方式;
            * Banner.Mode.LOG:日志输出方式;
            */
    //application.setBannerMode(Banner.Mode.OFF);
    application.run(args);
}

 当启动后,可以查看日志系统

┬┴┬/ ̄\_/ ̄\
┬┴┬┴▏  ▏▔▔▔▔\
┴┬┴/\ /      ﹨
┬┴∕       /   )
┴┬▏        ●  ▏
┬┴▏           ▔█ 
┴◢██◣      \__/   !
┬█████◣       /  
┴█████████████◣
◢██████████████▆▄
█◤◢██◣◥█████████◤\
◥◢████ ████████◤   \
┴█████ ██████◤      ﹨
┬│   │█████◤         ▏
┴│   │               ▏
┬∕   ∕    /▔▔▔\     ∕
┴/___/﹨   ∕     ﹨  /\


#这个是springboot的版本号
1.5.4.RELEASE
#这个是springboot的版本号
 (v1.5.4.RELEASE)
2017-06-10 13:24:25.406  INFO 69788 --- [  restartedMain] com.csg.Example                          : Starting Example on DESKTOP-F36IHM2 with PID 69788 (J:\work1\target\classes started by csg in J:\work1)
2017-06-10 13:24:25.406  INFO 69788 --- [  restartedMain] com.csg.Example                          : No active profile set, falling back to default profiles: default
2017-06-10 13:24:25.408  INFO 69788 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4fc2d46b: startup date [Sat Jun 10 13:24:25 CST 2017]; root of context hierarchy
2017-06-10 13:24:25.568  INFO 69788 --- [  restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 1111 (http)
2017-06-10 13:24:25.568  INFO 69788 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2017-06-10 13:24:25.568  INFO 69788 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.15
2017-06-10 13:24:25.577  INFO 69788 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext


会记录下启动的每一个过程

启动失败后,也会有相应的错误描述信息。


***************************
APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 1111 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 1111, or configure this application to listen on another port.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值