创建完成第一个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. NGINX 缓存使用指南

    NGINX 缓存使用指南 [proxy_cache] Nginx 一个web缓存坐落于客户端和“原始服务器(origin server)”中间,它保留了所有可见内容的拷贝.如果一个客户端请求的内容在缓 ...

  2. 北大BBS2008年毕业生晒工资

    http://www.amznz.com/19/快消类: 宝洁:本7200.研8200.博9700,均14个月,另有800交通补助,marketing每9个月 涨20%-30%. 玛氏:月薪10000 ...

  3. PHP面试题及答案解析(6)—PHP网络编程

    1.禁用COOKIE后SEESION还能用吗? 可以,COOKIE和SESSION都是用来实现会话机制的,由于http协议是无状态的,所以要想跟踪一个用户在同一个网站之间不同页面的状态,需要有这么一个 ...

  4. https 加载问题

    https的网站,加载的资源要全部https,如果里面有http的资源,很多浏览器是加载不进来 要地址栏变绿,网站内部全部引用都是https的

  5. nginx限速

    nginx 要实现限速,完整的实现是要限制客户端请求频率,并发连接和传输速度 1.请求限制 Nginx 请求限制的功能来自于 ngx_http_limit_req_module 模块.使用它需要首先在 ...

  6. PHP curl post header

    第三方教程推荐:https://www.cnblogs.com/CHEUNGKAMING/p/5717429.html

  7. Django--登录认证

    COOKIE 与 SESSION 概念 cookie的使用,不止局限于我们所使用的登录认证,cookie不属于http协议范围,由于http协议无法保持状态,但实际情况,我们却又需要“保持状态”,因此 ...

  8. Debian 升级到 PHP 7,并支持并行安装

    Debian 开发者 Ondřej Surý 前几天在一个邮件列表中宣布他们开始迁移到 PHP 7.x 了,并支持多版本并行安装co-installable.而此前几天,Ubuntu 也宣布其下一个版 ...

  9. .net之Ajax获取接口数据并实现循环播放

    <script type="text/javascript"> var xhr; ; var res; window.onload = function () { xh ...

  10. 搭建redis集群遇到的坑

    搭建redis集群遇到的坑 #!/bin/bash # 作者: tuhooo # 日期: 2017.4.23 20.15 # 用途: 通过ruby脚本启动redis伪集群 if [ $2 == &qu ...