SpringBoot2.0启动报错

Stella981
• 阅读 647

SpringBoot2.0.1启动用idea启动可以正常运行,但是mvn编译后启动失败 报错日志如下

2018-04-13 10:18:58.843 [main] WARN  o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - [AbstractApplicationContext.java:558] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
2018-04-13 10:18:58.855 [main] ERROR org.springframework.boot.SpringApplication - [SpringApplication.java:842] - Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)
        at com.hualala.shopcrm.data.ApplicationMain.main(ApplicationMain.java:27)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:204)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:178)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152)
        ... 16 common frames omitted

问题原因是springBoot2.0 依赖的tomcat版本必须在8.5以上,排查发现项目中配置的tomcat版本为8.0.33 pom中有这样的配置 <tomcat.version>8.0.33</tomcat.version> 改为 <tomcat.version>8.5.29</tomcat.version> 后启动正常

点赞
收藏
评论区
推荐文章
待兔 待兔
4个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Easter79 Easter79
3年前
tomcat无法连接本地服务器问题
更新系统后IDEA下启动项目失败,报错:/Users//tomcat/tomcat7.0.70/bin/catalina.shrunConnectedtothetargetVM,address:'127.0.0.1:57716',transport:'socket'2016110511:53
Easter79 Easter79
3年前
tidb集群某个节点报错之:node_exporter
今天启动集群tidb时出现一个错误,是某个tikv节点报错:node\_exporter9100.service failed一个节点的问题会导致整个集群启动失败。去此节点下的日志文件中查找,发现没有什么报错原因。无奈此时只能去系统日志中查看发生了什么问题果然发现了问题Jan1615:35:05ip1723126133
Wesley13 Wesley13
3年前
RAC环境单实例启动数据库收到ORA
     在RAC环境中,如果你在没有启动节点的集群服务的情况下单实例启动数据库,将收到类似如下的报错:\oracle@rhel1u01\$sqlSQL\Plus:Release10.2.0.5.0ProductiononTueApr215:00:272013Copyright(
Stella981 Stella981
3年前
Manjaro
ManjaroDeepin启动报错:FailedtostartLoadKernelModules.通过sudosystemctlstatussystemdmodulesload.service查看日志如下:●systemdmodulesload.serviceLoadKern
Stella981 Stella981
3年前
Abnormal build process termination
iDEA启动后报Error:Abnormalbuildprocessterminatio报错的原因如下:Error:Abnormalbuildprocesstermination:"C:\\ProgramFiles\\Java\\jdk1.8.0\_121\\bin\\java"Xmx700mDja
Stella981 Stella981
3年前
CentOS 7 安装 mysql workbench
centos7.4安装mysqlworkbench最新版,启动失败,报错如下;mysqlworkbenchbinkilledbySIGSEGV。网络搜索后无解,后在mysql论坛找到解决方案。链接如下:https://forums.mysql.com/read.php?152,661138,663325(https://www.os
Easter79 Easter79
3年前
SpringBoot2.0启动报错
SpringBoot2.0.1启动用idea启动可以正常运行,但是mvn编译后启动失败报错日志如下2018041310:18:58.843mainWARNo.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContextAbstractApplicationCo
Easter79 Easter79
3年前
SringBoot启动报日志配置错误
最近在启动项目的时候,报错,报错的原因是springBoot日志配置文件不对。由于自己是刚接触springboot,是同事帮忙解决的,自己非常感谢!先总结如下:1.首先,找到logbackspring.xml配置文件1<springPropertyscope"context"name"springAppNa
京东云开发者 京东云开发者
5个月前
奇怪!应用的日志呢??
1.问题回顾问题背景是在进行中台应用中间件迁移过程中,发现存在项目启动失败或者项目正常启动(jsf正常挂载并正常运行,mq正常发送和消费)但是无任何日志打印现象。更奇怪的是不打印日志竟然是偶发的,在测试环境中多次部署都未出现项目启动但无日志打印情况,而且玄