java后端自学错误总结spring持续更新中

java后端自学错误总结

一.SpringBoot--正在总结中

1.循环嵌套异常

今天再写SpringCloud项目的时候书写测试类运行结果报错了报错的最后的信息是

java 复制代码
The dependencies of some of the beans in the application context form a cycle:
 
    newsConfigController (field private com.shengkong.article.service.newsConfigService com.shengkong.article.controller.v1.newsConfigController.newsConfigService)
      ↓
   newsConfigServiceImpl (field protected com.baomidou.mybatisplus.core.mapper.BaseMapper com.baomidou.mybatisplus.extension.service.impl.ServiceImpl.baseMapper)
      ↓
   newsConfigMapper defined in file [E:\shengkong\shengkongtoutiao\shengkong_news\shengkong_news-view\target\classes\com\shengkong\article\mapper\NewsConfigMapper.class]
      ↓
   sqlSessionFactory defined in class path resource [com/shengkong/seata/config/DataSourcesProxyConfig.class]
┌─────┐
|  dataSourceProxy defined in class path resource [com/shengkong/seata/config/DataSourcesProxyConfig.class]
↑     ↓
|  druidDataSource defined in class path resource [com/shengkong/seata/config/DataSourcesProxyConfig.class]
↑     ↓
|  org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker
 Error creating bean with name 'druidDataSource' defined in class path resource [com/shengkong/seata/config/DataSourcesProxyConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'dataSourceProxy': Requested bean is currently in creation: Is there an unresolvable circular reference?

项目里面我是继承了mybatis-plus

看到这个报错的时候优先排查了一下mapper.xml的文件里面是否出现了类名路径书写错误排查了没有

然后又去查看了启动类注解里面的MapperScan注解对应的mapper文件路径是不是有问题,查看了还是没问题

排查到这里以后我就看了ctrl+alt+shift+u 查看了对应的关系发现还是没有什么循环依赖的问题

排查到这里有点崩溃了因为技术水平不够实在找不到哪里出了问题,希望有知道的大佬们可以解答一下---------炸裂炸裂炸裂

最后我是再启动类上加了

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})

才让测试类的启动正常的

2.项目起来卡住了怎么办

这个时候可以考虑看看是不是idea的断点导致的可以将断点取消掉再去重启项目,目前遇到这种情况

二.SpringCloud--正在总结中

相关推荐
张张123y22 分钟前
后端第十四课:Agent 记忆系统(让 Agent 记住上下文和用户,跨会话不健忘)
java·大数据·人工智能·python·agent·记忆
曹牧5 小时前
C#:空合并运算符
java·前端·数据库
布吉岛的石头5 小时前
Java 程序员第 50 阶段2:预训练的目标函数:自回归语言建模本质
java·开发语言·人工智能·深度学习·回归·transformer
golang学习记5 小时前
IDEA 2026年的玩法已经完全不同
java·ide·intellij-idea
紧跟先前的步伐6 小时前
Go AI Agent 实战 05|Temperature 与生成参数:让模型输出可控
java·人工智能·golang
金銀銅鐵6 小时前
[Java] 展示添加元素时 ArrayList 的内部变化
java·后端·ai编程
斌糖雪梨6 小时前
spring auth 核心流程详解
java·后端·spring
文丑颜不良啊8 小时前
LeetCode201~225题目解析
java·leetcode
SL_staff9 小时前
4G设备掉线三层归因指南:SIM卡、模组、JVS-IOT网关配置精准锁定
java·物联网·产品
Wang's Blog10 小时前
Java 项目实战: 交友项目 - 黑名单:取消黑名单
java·windows·交友