Bean with name 'xxxService' has been injected into other beans [xxxServiceA,xxxServiceB] in its raw version as part of a circular reference, but has eventually been wrapped
启动项目,通过@Autowired注入对象,出现循环依赖,导致项目启动失败,具体报错信息如下:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xxxtController':
Unsatisfied dependency expressed through field 'xxxService'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException:
Error creating bean with name 'xxxService': Bean with name 'xxxService' has been injected into other beans [xxxServiceA,xxxServiceB]
in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean.
This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off
Bean with name 'xxxService' has been injected into other beans [xxxServiceA,xxxServiceB] in its raw version as part of a circular reference, but has eventually been wrapped
翻译:xxxService 这个bean已经被注入到xxxServiceA、xxxServiceB这两个bean中了,他们之间存在循环引用(依赖),也就是说:xxxServiceA中注入了xxxService,而xxxService中也要注入xxxServiceA,所以就会出现这种情况
参考:https://www.cnblogs.com/leng39/p/9530569.html
Bean with name 'xxxService' has been injected into other beans [xxxServiceA,xxxServiceB] in its raw version as part of a circular reference, but has eventually been wrapped的更多相关文章
- Spirng 循环依赖报错:Requested bean is currently in creation: Is there an unresolvable circular reference?
1:前言 最近在项目中遇到了一次循环依赖报错的问题,虽然解决的很快,但是有些不明白的地方,特此记录. 在此我把 bean 的结构和 注入方式单独拎出来进行演示 1.1:报错提示 1.2:错误日志 Ex ...
- SpringBoot项目意外出现 循环依赖和注入的对象意外是Null的问题 Requested bean is currently in creation: Is there an unresolvable circular reference? 或 nested exception is java.lang.NullPointerException
1.Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ...
- Requested bean is currently in creation: Is there an unresolvable circular reference?
spring容器初始化报错:循环依赖,错误信息如下: Requested bean is currently in creation: Is there an unresolvable circula ...
- 创建在类路径资源[applicationcontext]中定义名为“工厂”的bean时出错。:在设置bean属性“dataSource”时,无法解析对bean“dataSource”的引用;嵌套异常是org.springframe .beans.factory。BeanCreationException:创建名为“数据源”的bean时出错,该名称是在类路径资源[applicationcontext
控制台报错: 创建在类路径资源[applicationcontext]中定义名为“工厂”的bean时出错.:在设置bean属性“dataSource”时,无法解析对bean“dataSource”的引 ...
- springboot 异常: Requested bean is currently in creation: Is there an unresolvable circular reference?
2018-07-31 11:56:18.812 WARN 10316 --- [ main] ConfigServletWebServerApplicationContext : Exception ...
- 【异常】Application failed to start due to an exception org.springframework.beans.factory.BeanCurrentlyInCreationException
一. 异常信息: 2018-05-17 18:03:22.224 -DEBUG [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter ...
- spring 拾遗
1.@PostConstruct VS init-method 1.1 both BeanPostProcessor 1.2 @PostConstruct is a JSR-250 annotati ...
- Spring IoC源码解析——Bean的创建和初始化
Spring介绍 Spring(http://spring.io/)是一个轻量级的Java 开发框架,同时也是轻量级的IoC和AOP的容器框架,主要是针对JavaBean的生命周期进行管理的轻量级容器 ...
- spring源码 — 二、从容器中获取Bean
getBean 上一节中说明了容器的初始化,也就是把Bean的定义GenericBeanDefinition放到了容器中,但是并没有初始化这些Bean.那么Bean什么时候会初始化呢? 在程序第一个主 ...
随机推荐
- Hihocoder #1014 : Trie树 (字典数树统计前缀的出现次数 *【模板】 基于指针结构体实现 )
#1014 : Trie树 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助, ...
- HUST1017 Exact cover —— Dancing Links 精确覆盖 模板题
题目链接:https://vjudge.net/problem/HUST-1017 1017 - Exact cover 时间限制:15秒 内存限制:128兆 自定评测 7673 次提交 3898 次 ...
- Java内存溢出?
内存溢出? https://www.cnblogs.com/crossoverJie/p/9552119.html 前言 OutOfMemoryError 问题相信很多朋友都遇到过,相对于常见的业务异 ...
- 非旋treap (BZOJ1895)
记个板子,还是挺好用的. #include <bits/stdc++.h> using namespace std; ]; int rt,n,m,l,r,x,A,B,C,t; struct ...
- [laravel]请求处理
请求进入 public/index.php 文件. bootstrap/start.php 文件创建应用程序对象并检测环境. 内部的 framework/start.php 文件配置相关设置并加载服务 ...
- [angularJS]ng-hide|ng-show切换
<div class="row ng-scope"> <div class="col-lg-12"> <h1 class=&quo ...
- Vue中devtools安装使用
vue.js的devtools安装 安装 1.github下载地址:https://github.com/vuejs/vue-devtools 2.下载好后进入vue-devtools-master工 ...
- pair运用
#include <iostream> #include <string> #include <map> #include <algorithm> us ...
- django上课笔记1-目录介绍-路由系统-ORM操作
一.Django目录介绍 django-admin startproject mysite # 创建名为mysite的项目 cd mysite # 切换到该目录下 python manage.py s ...
- poj3187【dfs】
挑战-搜索 题意: 给一个n和sum,代表n层的杨辉三角,然后给一个和,问最低层的数字情况. 思路: ①:预处理一个底层对于和的系数数组, sum = 0Cn-1*num[1] + 1Cn-1*num ...