刚开始用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相关推荐

  1. SpringBoot报错Unsatisfied dependency expressed through field userMapper和Whitelabel Error Page解决方案

    搜索下面的错误信息得到解决方法 Unsatisfied dependency expressed through field 'userMapper' 项目结构如下 解决办法 在启动类中加入注解 里面 ...

  2. 【错误记录】Error creating bean with name: Unsatisfied dependency expressed through field

    启动一个Spring boot集成mybatis plus报错: Error creating bean with name 'examManageController': Unsatisfied d ...

  3. Unsatisfied dependency expressed through field 'service'

    启动SpringBoot项目报以下错误 Error starting ApplicationContext. To display the conditions report re-run your ...

  4. 使用dubbo遇到了Unsatisfied dependency expressed through field ‘userService‘

    在配置dubbo消费者的时候遇到了一个问题,提供者的接口无法注入 错误详情 org.springframework.beans.factory.UnsatisfiedDependencyExcepti ...

  5. 报错-Error creating bean with name xxx: Unsatisfied dependency expressed through field xxx

    报错异常: Error creating bean with name 'loginController': Unsatisfied dependency expressed through fiel ...

  6. 解决异常Error creating bean with name ‘xxxxxController‘: Unsatisfied dependency expressed through field

    今天来聊一下常见的异常,异常信息如下图所示: 错误信息如下: Error creating bean with name 'helloController': Unsatisfied dependen ...

  7. Error creating bean with name ,Unsatisfied dependency expressed through field

    今天打开idea发现项目跑不起来了,一直报这个错 org.springframework.beans.factory.UnsatisfiedDependencyException: Error cre ...

  8. Unsatisfied dependency expressed through field 'baseMapper'

    今天项目 springboot 1.* 升级到 2.0.4,以至于将 Mybatis-Plus 升级,springBoot 启动之后报错Unsatisfied dependency expressed ...

  9. 报错:Unsatisfied dependency expressed through field 'xxxService';

    报错片段: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with nam ...

  10. Unsatisfied dependency expressed through field ‘userMapper‘问题解决

    SSM框架练手,mapper层@Autowire创建bean怎么也不成功,报错:org.springframework.beans.factory.UnsatisfiedDependencyExcep ...

最新文章

  1. Android 中文 SDK (47) —— Filter
  2. UNIX系统编程(2)
  3. WIFI搜索的到别人,却找不到自己家的wifi
  4. 3.8 matlab函数参数与变量的作用域
  5. Red5 配置RTMPT
  6. BNUOJ-26474 Bread Sorting 逆序对
  7. android 分组柱状图_整理了一个 android 上的波形图及柱状图绘制控件
  8. 小程序使用wx.uploadFile上传图片报错:uploadFile:fail Error: connect ECONNREFUSED
  9. python ssl_Python3 ssl模块不可用的问题
  10. 为Angular(2+)开发人员提供带TypeScript的Vue.js
  11. Jmeter命令行执行并生成HTML报告
  12. pandas—显示行索引与列索引(数组或者列表)
  13. BZOJ 3926: [Zjoi20150]诸神眷顾的幻想乡
  14. 推荐几本计算流体力学(CFD)书籍
  15. AtCoder - ABC 168 - E(数学推理)
  16. c语言单片机仿真keil,如何在keil中仿真stm32单片机
  17. 图解快速排序(C++实现)
  18. C 语言do with,Nonverbal (非语言的) communication has to do with gestures, movements andcloseness of two...
  19. 如何转行做数据分析师?
  20. 带有两位小数的元转分

热门文章

  1. 平面中点与圆的位置关系
  2. Python:32实现Circle类,求圆的面积、周长、指定点与圆的关系
  3. Userenv 1058
  4. java,56个民族enum
  5. GIT 技巧命令讲解笔记2020 (二)
  6. 实现Java代码压缩解压
  7. 拼音爱好者的好消息:紫光V6发版 1
  8. 如何绑定腾讯云的域名到 godaddy 的站点
  9. EN 16034: 防火门CE认证
  10. C语言编写的简单HTTP json RPC