关于idea,springboot启动最新版ibase4j报Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

使用ibase4j开发了一段时间,两个字“好用”。不过最近有新入行的朋友需要分享一下ibase4j。
于是就去下载了最新版本的ibase4j,给新朋友演示。后面就出问题了,项目启动就报:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-09-03 17:07:53.540 [main] ERROR [SpringApplication: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) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]at org.ibase4j.SysServiceApplication.main(SysServiceApplication.java:13) [classes/:?]
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) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:178) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]... 8 more

这个错误,后面使用百度csdn博文+翻看源码+ibase4j Q群询问后发现是如下代码导致:

在ibase4j的主maven配置文件pom.xm里有关springboot的依赖tomcat有如下配置

        <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId><scope>provided</scope></dependency>

scope:provided表示产于编译运行,但不参与打包,打包由生产环境提供。
于是把scope的provided改成了complie,果然启动成功。
但是,作者既然这样配置,那么表示应该是可以运行的。考虑到作者可能是用eclipse开发。
于是查看了idea的启动配置,果然发现了问题。

选择Edit Configuration…

选择SpringBoot的配置,勾上Include dependencies with “Provided” scope
点击OK
再次启动项目,运行成功!

总结这个应该是开发环境差异导致。明显idea提供这个勾选项,是为了方便用户打包,但是在运行时,需要勾上。
参考:
1、iBase4J一群 聊天记录
2、maven中scope标签详解

关于idea,springboot启动最新版ibase4j报Unable to start ServletWebServerApplicationContext due to missing Serv相关推荐

  1. 【Spring] Spring boot 报错 Unable to start ServletWebServerApplicationContext due to missing ServletWe

    1.概述 spring 报错如下 Error starting ApplicationContext. To display the conditions report re-run your app ...

  2. 本地启动出错Unable to start ServletWebServerApplicationContext due to miss ServletWebServerFactory bean

    Springboot项目打包成war上传到云服务器后,本地启动出错. 首先,我们去除为了上传云服务器所添加的步骤,详细见我的另一篇文章Springboot项目部署到阿里云服务器(war和jar) 然后 ...

  3. springboot启动失败的原因及其解决方法

    前言: 对于springboot的启动失败,相信大家都有经历,但是为什么会启动失败,以及怎么解决都只能通过日志进行查看,在这里,我会将常见的springboot启动失败的报错一一展示 报错: 1:端口 ...

  4. 记一次Springboot启动异常

    启动Springboot项目报以下异常: org.springframework.context.ApplicationContextException: Unable to start web se ...

  5. springboot启动流程

    一句话总结:在context的refresh方法中,需要注册bean definition,实例化bean.在加载bean defintion的时候使用ConfigurationClassParser ...

  6. springboot 启动的时候报错 Error creating bean with name 'solrClient'

    springboot 启动的时候报错: org.springframework.beans.factory.BeanCreationException: Error creating bean wit ...

  7. springboot启动报错:Unregistering JMX-exposed beans on shutdown

    环境 1,maven 3.5.0 2,eclipse 4.7.1 3,spring boot 1.5.9.RELEASE springboot启动报错 按照spring 用户手册创建新的spring ...

  8. SpringBoot 启动报错:Failed to configure a DataSource: ‘url‘ attribute is not specified and no emb

    目录 一.报错日志 二.原因分析 三.问题排查 四.解决方案 方案一:如果项目不需要数据库相关信息就排除此类的autoconfig 方案二:配置文件添加数据库链接信息 方案三:配置pom.xml中ym ...

  9. Springboot 启动时Bean初始化,启动异常-Assert.isTrue(condition,message) 报错

    Springboot 启动时Bean初始化启动异常Assert.isTrue(condition,message) 报错,如果 condition为false 则会出现 java.lang.Illeg ...

  10. SpringBoot启动报错:Parameter 0 of method hmset in com.qcby.rbac.util.RedisUtils required a bean of type

    SpringBoot启动报错,报错信息如下: 报错是由于A类中定义了含参数的构造函数,Spring自动构造和注入时未为该Bean传入参数,引起报错. 查了很多资料,最后发现,我是因为注释的时候没有把@ ...

最新文章

  1. ArrayList和LinkedList区别
  2. tomcat如何将请求分发到servlet
  3. 某公司邮件系统的安全检测
  4. python无法使用1号gpu_详解tensorflow2.x版本无法调用gpu的一种解决方法
  5. 2019 Java发展趋势报告:Java老矣,Java正年轻
  6. MySQL 第二次练习(源码安装、数据库和表的建立)
  7. Android 代码混淆、第三方平台加固加密、渠道分发 完整教程(转)
  8. Layui数据表格动态禁用checkbox
  9. 电子海图信息系统 (ECDIS)的发展及应用
  10. Educoder jQuery 入门
  11. 华为手机桌面计算机消失怎么办,华为手机桌面所以图标不见了怎么办
  12. 这可能是 Python 里最强的绘制地图神器
  13. PTA数字金字塔(PTA怎么用以及代码怎么敲)
  14. c语言多进程之进程间通信IPC:信号操作函数之signal,kill
  15. 什么是QA?QA是什么意思?
  16. vue+element-ui JYAdmin后台管理系统模板-集成方案【项目搭建篇1】
  17. python可视化工具:matplotlib+pyecharts使用详解
  18. 三菱plc pwm指令_三菱电机PLC学习:高速指令
  19. C/C++学习教程:C语言排序算法—插入排序算法
  20. mysql九九查询法_mysql日期查询法

热门文章

  1. Multisim10的4013BD_5V测试电路
  2. 软件安装包制作工具installshield 2020 R1的安装教程
  3. 概率论于数理统计(陈希孺)笔记2.3
  4. 矩阵分析与应用(二)——内积与范数
  5. windows xp下 usb驱动编写
  6. Mac上删除音频设备
  7. windowsxp系统怎么装iis服务器,XP系统如何安装IIS?IIS安装教程
  8. Delphi 2009 安装序列号
  9. 计算机操作系统(第3版)课后习题答案(完整版)
  10. 微软应用商店应用无法联网_微软,诺基亚应用商店-即将开业!