Unsatisfied dependency expressed through field
刚开始用Spring注解,编译通过,运行时报错Error creating bean with name…:Unsatisfied dependency expressed through field…nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException之类,大致意思是创建Bean失败, 最后查到原因是在@Service注解的类中直接使用Spring注入的对象,导致加@Service注解的类创建Bean不成功,如下
@Autowiredprivate CommonPropertiesUtil util;@Autowiredprivate CommonService commonService;String SECRET_SEX = util.getSecretSex()//直接使用的注入对象util;String SECRET_USER = util.getSecretUser();
把String SECRET_USER = util.getSecretUser()从类中移到方法中运行正常了,不太了解Spring底层,不知为啥注入对象不能再类中直接调用…
Unsatisfied dependency expressed through field相关推荐
- SpringBoot报错Unsatisfied dependency expressed through field userMapper和Whitelabel Error Page解决方案
搜索下面的错误信息得到解决方法 Unsatisfied dependency expressed through field 'userMapper' 项目结构如下 解决办法 在启动类中加入注解 里面 ...
- 【错误记录】Error creating bean with name: Unsatisfied dependency expressed through field
启动一个Spring boot集成mybatis plus报错: Error creating bean with name 'examManageController': Unsatisfied d ...
- Unsatisfied dependency expressed through field 'service'
启动SpringBoot项目报以下错误 Error starting ApplicationContext. To display the conditions report re-run your ...
- 使用dubbo遇到了Unsatisfied dependency expressed through field ‘userService‘
在配置dubbo消费者的时候遇到了一个问题,提供者的接口无法注入 错误详情 org.springframework.beans.factory.UnsatisfiedDependencyExcepti ...
- 报错-Error creating bean with name xxx: Unsatisfied dependency expressed through field xxx
报错异常: Error creating bean with name 'loginController': Unsatisfied dependency expressed through fiel ...
- 解决异常Error creating bean with name ‘xxxxxController‘: Unsatisfied dependency expressed through field
今天来聊一下常见的异常,异常信息如下图所示: 错误信息如下: Error creating bean with name 'helloController': Unsatisfied dependen ...
- Error creating bean with name ,Unsatisfied dependency expressed through field
今天打开idea发现项目跑不起来了,一直报这个错 org.springframework.beans.factory.UnsatisfiedDependencyException: Error cre ...
- Unsatisfied dependency expressed through field 'baseMapper'
今天项目 springboot 1.* 升级到 2.0.4,以至于将 Mybatis-Plus 升级,springBoot 启动之后报错Unsatisfied dependency expressed ...
- 报错:Unsatisfied dependency expressed through field 'xxxService';
报错片段: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with nam ...
- Unsatisfied dependency expressed through field ‘userMapper‘问题解决
SSM框架练手,mapper层@Autowire创建bean怎么也不成功,报错:org.springframework.beans.factory.UnsatisfiedDependencyExcep ...
最新文章
- Android 中文 SDK (47) —— Filter
- UNIX系统编程(2)
- WIFI搜索的到别人,却找不到自己家的wifi
- 3.8 matlab函数参数与变量的作用域
- Red5 配置RTMPT
- BNUOJ-26474 Bread Sorting 逆序对
- android 分组柱状图_整理了一个 android 上的波形图及柱状图绘制控件
- 小程序使用wx.uploadFile上传图片报错:uploadFile:fail Error: connect ECONNREFUSED
- python ssl_Python3 ssl模块不可用的问题
- 为Angular(2+)开发人员提供带TypeScript的Vue.js
- Jmeter命令行执行并生成HTML报告
- pandas—显示行索引与列索引(数组或者列表)
- BZOJ 3926: [Zjoi20150]诸神眷顾的幻想乡
- 推荐几本计算流体力学(CFD)书籍
- AtCoder - ABC 168 - E(数学推理)
- c语言单片机仿真keil,如何在keil中仿真stm32单片机
- 图解快速排序(C++实现)
- C 语言do with,Nonverbal (非语言的) communication has to do with gestures, movements andcloseness of two...
- 如何转行做数据分析师?
- 带有两位小数的元转分