文章目录

  • 摘要
  • 情况1:Nacos报错
  • 情况2:IllegalStateException: Incompatible fallbackFactory instance
  • 情况3:idea编译java文件错误 非法字符: '\ufeff'
  • 情况4:No URLs will be polled as dynamic configuration sources
  • 情况5:there is already xxx bean method
  • 情况6:Hibernate-Validator相关错误
  • 情况7:register项目启动报错:Protocol handler start failed
  • 情况8:测试类 you need to use @SpringBoot(CLASSES=...) with your test
  • 情况9:kafka报错 Broker may not be available
  • 情况10:ES报错 maven包引入问题ClassNotFoundException: org.elasticsearch.client.Cancellable
  • 情况11:Springboot多模块启动时,总是找不到子模块的bean

摘要

本文章介绍我自己在搭配第三方一起使用途中遇到的错误,导致项目无法启动问题,进行汇总说明。

场景:

  1. 使用Nacos时
  2. 使用kafka时
  3. 使用ES时
  4. 多模块启动时
  5. 使用微服务Feign调用时

情况1:Nacos报错



原因:编译时target包里面少了bootstrap.properties文件(但目前集体不知道为啥会这样)

解决方案:最右侧“maven”点击package,会把整个项目进行打包,这时候的配置文件就都会加载了。我猜测原因可能是idea配置的环境有问题,因为别人down下来的代码是可以运行的,但我这边就不行!

情况2:IllegalStateException: Incompatible fallbackFactory instance


原因:实现方式不一样

解决方案:使用另一种实现方式


相关文章:https://blog.csdn.net/weixin_34250709/article/details/85973840

情况3:idea编译java文件错误 非法字符: ‘\ufeff’


原因:编码不一致导致

情况4:No URLs will be polled as dynamic configuration sources

解决方案: 在resources中添加文件config.properties

情况5:there is already xxx bean method


原因:@requestMapping路径相同

情况6:Hibernate-Validator相关错误


原因:缺少Hibernate-Validator依赖

解决方案:

<!--新添加的Hiberbate-Validator依赖-->
<dependency><groupId>org.hibernate</groupId><artifactId>hibernate-validator</artifactId><version>5.2.4.Final</version>
</dependency>

情况7:register项目启动报错:Protocol handler start failed


原因:有可能是端口冲突了

解决方案:关闭java进程就好了

情况8:测试类 you need to use @SpringBoot(CLASSES=…) with your test


原因:因为单元测试的路径和main下application.class启动类的包名不一致

解决方案:测试类改包名和启动类包名一致即可

情况9:kafka报错 Broker may not be available


原因:配置文件中kafka的IP或者端口有问题

解决方案:改配置文件

情况10:ES报错 maven包引入问题ClassNotFoundException: org.elasticsearch.client.Cancellable

原因:父pom引入ES 版本了,导致版本冲突

解决方案:修改父pom的ES的版本即可启动成功

情况11:Springboot多模块启动时,总是找不到子模块的bean

原因:
Springboot多模块启动时,总是找不到子模块的bean,这是因为启动Applicaiton 中总是默认扫描当前项目的目录,而不会去扫描子项目的bean,所以这里找不到。

解决方案:
在启动Application 上注明扫描路径

springboot项目启动报错-案例情景介绍相关推荐

  1. SpringBoot项目启动报错:Field userMapper in com.demo.controller.MemberController required a bean of type ‘c

    问题描述: SpringBoot项目启动报错,报错内容:'com.xxx.mapper.XxxxMapper' that could not be found ******************** ...

  2. SpringBoot项目启动 报错:Error executing Maven. end tag name </settings> must match start tag name

    SpringBoot项目启动 报错:Error executing Maven. end tag name must match start tag name from line xxx 第一次创建s ...

  3. idea软件 springboot项目启动报错:命令行太长解决

    idea软件 springboot项目启动报错:命令行太长解决 1.找到项目下得.idea文件夹,打开文件workspace.xml 2.搜索标签 <component name="P ...

  4. 【图文详解】SpringBoot项目启动报错:The bean ‘xxxServiceImpl‘ could not be injected as a ‘xxxServiceImpl‘ ...

    问题描述: 项目启动报错:The bean 'xxxServiceImpl' could not be injected as a 'cn.xxxx.service.xxxServiceImpl' b ...

  5. SpringBoot项目启动报错[类文件具有错误的版本 61.0, 应为 55.0 请删除该文件或确保该文件位于正确的类路径子目录中。]

    Web server failed to start. Port 80 was already in use. Web server failed to start. Port 80 was alre ...

  6. SpringBoot项目启动报错,java.lang.IllegalStateException: Ambiguous mapping.访问路径模棱两可,无法映射的问题!!!

    问题描述: SpringBoot项目刚启动就报错 下面是报错信息: 我这里提取了一下关键信息 Ambiguous mapping.(模棱两可的mapping) Cannot map 'test' me ...

  7. 【踩坑日记】springboot项目启动报错error create bean with name

    前言 启动springboot项目报错error create bean with name xxx 以为是哪个bean没有装配上,排查了所有的bean,发现都装配了 原因分析 仔细看了报错日志,发现 ...

  8. springboot 项目启动报错 url' attribute is not specified and no embedded datasource could be configured

    报错信息: Error starting ApplicationContext. To display the conditions report re-run your application wi ...

  9. springboot项目启动报错:The web application [ROOT] appears to have started a thread named [xx] but has fai

    首先看看报错信息:只看到说可能是内存泄露,具体为啥报错也不知道 遇到这种报错,刚开始一般可能都不太会解决,而且可能之前遇到过,发现解决方法可能会不一样. 遇到这种启动失败,报内存泄漏的错误时不要看框里 ...

最新文章

  1. java对象 Java中 VO、 PO、DO、DTO、 BO、 QO、DAO、POJO的概念
  2. mysql core 文件_MySQL未能加载文件或程序集“Ubiety.Dns.Core”或它的某一个依赖项 问题的解决...
  3. c_str 以及atoi
  4. Linux无法解析hosts里面绑定域名的排查方法
  5. string赋值-单引号和双引号的区别(php)
  6. java基础语法3 方法
  7. MySQL学习记录===待续
  8. elf 取路径_PatchELF 修改linux下elf文件library搜索路径
  9. MVC基础知识2——过滤器的使用(Filter)
  10. Android应用程序组件Content Provider的启动过程源代码分析(5)
  11. java中的 element_Java中队列的element()方法的用法
  12. 卡巴斯基v6.0激活码
  13. 城市天际线 for Mac城市建造类游戏
  14. poj计算几何题推荐
  15. 矩阵的rank,nullspace以及eigenvalue的理解
  16. VMware16调整了路径后界面全部变成了英文
  17. mockito的用法
  18. 2021年 PAT(乙级)
  19. 数据分析1-系统认识数据分析
  20. STATA:基础命令

热门文章

  1. AMD的复兴之路 发力ARM服务器芯片
  2. css引入第三方字体(等宽非衬线)
  3. Kafka部署、原理和使用介绍
  4. XPE优势与常见问题二
  5. 3.HTML——表格数据
  6. 看了某些蛊惑人心的招聘广告,实在忍不住想要提醒那些跃跃欲奉献的后生们...
  7. 英语总结系列(二十三):Baby上海一月游
  8. NotFoundError:Tensor name incept5b_1/... not found in checkpoint files /home/cqh2/...
  9. isam2 优化pose graph
  10. Eclipse4.2安装FlashBuilder插件