创建完成第一个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. modal html

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

  2. springboot 有用网址收集

    http://www.ityouknow.com/spring-boot.html springboot多数据源配置: https://blog.csdn.net/neosmith/article/d ...

  3. CPC23-4-K. 喵喵的神数 (数论 Lucas定理)

    喵喵的神∙数 Time Limit: 1 Sec Memory Limit: 128 MB Description 喵喵对组合数比較感兴趣,而且对计算组合数很在行. 同一时候为了追求有后宫的素养的生活 ...

  4. Chrome 完整版官方下载

    Chrome下载默认不是完整版本,需要长久等等.so... 在下载地址后加参数:?standalone=1  解决问题.

  5. C#IAsyncResult异步回调函数的解释

    问题:IAsyncResult ar 是如何通过ar.AsyncState强制转换成TCPClientState类型 答:实例中使用的方法如下 我给IAsyncResult ar传入了TCPClien ...

  6. Ubuntu Server 命令行下显示中文乱码(菱形)解决办法

    如果Ubuntu Server在安装过程中,选择的是中文(很多新手都会在安装时选择中文,便于上手),这样在完成安装后,系统默认的语言将会是中文zh_CN.UTF- 8.但问题是我们安装的是服务器,只需 ...

  7. hbase和mapreduce开发 WordCount

    代码: /** * hello world by world 测试数据 * @author a * */ public class DefinedMapper extends Mapper<Lo ...

  8. Word 操作

    1.出文件,最后一页是附件.最后一页的页码不想要.如何删除?用的是 office word 2010版本,跟07 03版本界面不一样. 在最后一页的最前面插入分节符:下一页 ,编辑页脚.让页脚“取消链 ...

  9. "fcitx按ctrl+space没反应"解决方法

    如果是KDM.GDM.LightDM,打开~/.xprofile.如果是startx.Slim,打开~/.xinitrc.(没有就新建一个) export GTK_IM_MODULE=fcitxexp ...

  10. [译]GLUT教程 - 位图和正交投影视图

    Lighthouse3d.com >> GLUT Tutorial >> Fonts >> Bitmap Fonts and Orthogonal Projecti ...