创建完成第一个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. redis学习笔记——数据类型

    对象处理机制 Redis 构建了自己的类型系统,这个系统的主要功能包括:• redisObject 对象.• 基于redisObject 对象的类型检查.• 基于redisObject 对象的显式多态 ...

  2. Transportation poj1040

    Ruratania is just entering capitalism and is establishing new enterprising activities in many fields ...

  3. lodash 展平数组 flatten flattenDeep

    _.flatten(array) 向上一级展平数组嵌套 <!DOCTYPE html> <html lang="zh"> <head> < ...

  4. Java + Selenium + Appium手机自动化测试

    一.启动测试机或者Android模拟器(Genymotion俗称世界上最快的模拟器,可自行百度安装) 二.启动Appium(Appium环境安装可自行百度) 三.安装应用到Genymotion上,如下 ...

  5. libpointmatcher的filter

    Maximum Density Filter Points are only considered for rejection if they exceed a density threshold, ...

  6. viewDidLayoutSubviews在ios7上导致应用崩溃

    在ios8中使用viewDidLayoutSubviews,应用正常运行,没有问题,但是应用在ios7上运行的时候,报错,导致应用崩溃,错误信息类似: Cannot find executable f ...

  7. 浅谈EntityFramework框架的使用

    第一步,建立一个类库,并且安装好EntityFramework框架还有CodingFirstUsingFluentApi安装包 第二步 : 第三步:配置好你的数据库连接信息,还有你需要操作的数据库,在 ...

  8. Lambda Expression in C#

    1.Expression Expression<Func<double, double>> exp = a => Math.Sin(a); 委托类型Func<dou ...

  9. 关于CDN对动态网站加速的一些看法

    CDN的全称是Content Delivery Network,即内容分发网络.其目的是通过在现有的Internet中增加一层新的网络架构,将网站的内容发布到最接近用户的网络"边缘" ...

  10. EF、Dapper、NHibernate等ORM框架的比较及优缺点

    什么是ORM? ORM的全称是Object Relational Mapping,即对象关系映射.它的实现思想就是将关系数据库中表的数据映射成为对象,以对象的形式展现,这样开发人员就可以把对数据库的操 ...