创建完成第一个Spring Boot项目后,准备运行,尝一下胜利的果实。
启动日志如下
  .   ____          _            __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.1.RELEASE) -- ::41.812 INFO --- [ main] com.example.demo01.Demo01Application : Starting Demo01Application on - with PID (D:\SpringBoot\project\demo01\target\classes started by Administrator in D:\SpringBoot\project\demo01)
-- ::41.821 INFO --- [ main] com.example.demo01.Demo01Application : No active profile set, falling back to default profiles: default
-- ::43.160 INFO --- [ main] com.example.demo01.Demo01Application : Started Demo01Application in 1.955 seconds (JVM running for 3.395) Process finished with exit code
没有报错,但是,这是一个web项目,为什么自己就结束了呢?
查阅资料(百度)
发现pom文件有问题,这里不啰嗦,直接上代码
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
pom文件中有这个依赖,这个是什么意思呢?
简单来说就是:我把外部的一个tomcat引入了。
这下你明白了吧,spring boot内部本来就有一个。你现在又引入了一个,这下出问题了。
解决方案:
把上述代码做掉(删除)。问题解决
重新启动项目:
日志如下
  .   ____          _            __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.1.RELEASE) -- ::18.385 INFO --- [ main] com.example.demo01.Demo01Application : Starting Demo01Application on - with PID (D:\SpringBoot\project\demo01\target\classes started by Administrator in D:\SpringBoot\project\demo01)
-- ::18.391 INFO --- [ main] com.example.demo01.Demo01Application : No active profile set, falling back to default profiles: default
-- ::19.851 INFO --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): (http)
-- ::19.875 INFO --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
-- ::19.875 INFO --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/9.0.
-- ::19.882 INFO --- [ main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [D:\Program Files\Java\jdk1..0_172\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\Python37;D:\Program Files (x86)\Sybase\PowerDesigner ;D:\oracle\product\10.2.\db_1\bin;D:\app\Administrator\product\11.2.\client_1;D:\maven\apache-maven-3.5.\bin;D:\Program Files\Java\jdk1..0_80\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.\;D:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin;D:\Program Files\EmEditor;D:\Python37\Scripts;D:\Python37\Lib\site-packages\Django-2.1.-py3..egg\django;D:\Program Files\Git\cmd;D:\Python37\Scripts\;D:\Python37\;.]
-- ::20.011 INFO --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
-- ::20.011 INFO --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in ms
-- ::20.236 INFO --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
-- ::20.463 INFO --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): (http) with context path ''
-- ::20.469 INFO --- [ main] com.example.demo01.Demo01Application : Started Demo01Application in 2.713 seconds (JVM running for 3.954)

未完待续。。。。。。。。。

下面继续....

番外篇

第一个Spring Boot程序启动报错了的更多相关文章

  1. 第一个Spring Boot程序启动报错了(番外篇)

    Spring Boot内嵌了一个容器,我可以不用吗?我能不能用外部的容器呢? 当然是可以的! 然后,下面代码在pom文件中一定要有哦! <dependency> <groupId&g ...

  2. Spring Boot从入门到精通(一)搭建第一个Spring Boot程序

    Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程.该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置.通过 ...

  3. 第一章 第一个spring boot程序(转载)

    第一章 第一个spring boot程序 本编博客转发自:http://www.cnblogs.com/java-zhao/p/5324185.html   环境: jdk:1.8.0_73 mave ...

  4. 我的第一个spring boot程序(spring boot 学习笔记之二)

    第一个spring boot程序 写在前面:鉴于spring注解以及springMVC的配置有大量细节和知识点,在学习理解之后,我们将直接进入spring boot的学习,在后续学习中用到注解及其他相 ...

  5. 第一个Spring Boot程序

    Windows 10家庭中文版,java version "1.8.0_152", Eclipse Oxygen.1a Release (4.7.1a),Spring Tools ...

  6. 【第一章】 第一个spring boot程序

    环境: jdk:1.8.0_73 maven:3.3.9 spring-boot:1.2.5.RELEASE(在pom.xml中指定了) 注意:关于spring-boot的支持, 最少使用jdk7(j ...

  7. 第一章 第一个spring boot程序

    环境: jdk:1.8.0_73 maven:3.3.9 spring-boot:1.2.5.RELEASE(在pom.xml中指定了) 注意:关于spring-boot的支持, 最少使用jdk7(j ...

  8. 创建spring boot项目启动报错遇到的问题

    1.Spring boot,Mybatis 启动报错 Failed to auto-configure a DataSource *************************** APPLICA ...

  9. spring boot项目启动报DataSource错误

    初建一个简单的spring boot 项目,启动后会报错. Exception encountered during context initialization - cancelling refre ...

随机推荐

  1. 利用eolinker实现api接口mock测试(mock server)

    转载:http://blog.csdn.net/naicha_qin/article/details/78276172 前后端分离或者是进行单元测试的时候,必须要用mock api替换掉第三方调用或者 ...

  2. 系统封装 如何打造原生WINPE

    1 安装微软的AIK(Windows Automated Installation Kit,Windows自动安装工具包),AIK简体中文版下载地址: http://download.microsof ...

  3. gitlab创建项目代码:

    cd (当前工程文件夹目录) git init     //初始化git git remote add origin http://worker.njbandou.com/KLElevator/kle ...

  4. modal html

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. 如何在Django1.6结合Python3.3版本中使用MySql

    用起了Python3.4跟Django1.6,数据库依然是互联网企业常见的MySql. 悲催的是在Python2.7时代连接MySql的MySQLdb还不支持Python3.4,还好,苦苦追问G哥终于 ...

  6. vue 生命周期组件渲染

    1.created 实例已完成以下的配置:数据观测 (data observer),属性和方法的运算,watch/event 事件回调.然而,挂载阶段还没开始,$el 属性目前不可见. 2.mount ...

  7. devpress grid表格自适应列宽的问题

    /// <summary> /// 自适应列宽,显示横向滚轴,只有当所有列都已经在界面上加载完成之后才能生效 /// </summary> public void setAut ...

  8. RAII手法封装相互排斥锁

    CriticalSectionWrapper是一个接口类 class CriticalSectionWrapper { public: // Factory method, constructor d ...

  9. Online advertising术语

    做项目发现非常多Online Advertising术语不懂,看代码感觉不那么清晰,如今来总结下遇到的一些术语. ---------------------------- 1. Online Adve ...

  10. SQLSERVER---- 通过位运算更改标志位

    当给多个中心传输数据时,怎么标记哪些单位推送了,哪些单位没有更新,如果单独设置一个字段,一来说,扩展不足,另外会造成数据库冗余,这里可以采用SQLSERVER的位运算. 比如说,更新标志位为0,长度为 ...