Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException解决

1、异常描述:

org.springframework.beans.factory.BeanCreationException: 
    Error creating bean with name 'shiroCasConfig': 
        Injection of autowired dependencies failed; 
    nested exception is java.lang.IllegalArgumentException:
        Could not resolve placeholder 'shiro.session.expireTime' in value "${shiro.session.expireTime}"

2、该异常产生原因一般会有3种情况:

  • 常见的就是配置文件有问题,比如说yml或properties文件配置有问题。
  • 引入的依赖有问题
  • 环境方面问题,比如说jdk不一致或是idea中的iml文件的问题

我所遇到的问题应该是归纳为环境的问题,我在解决该问题时,上述解决方案都进行过排查。多次尝试,最后发现属于项目编译有问题,我用的idea,更新项目后,项目就无法启动了,报上面的错误。最后我是如此解决的:idea --> build --> rebuild project 项目完美启动成功。

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
回答: "Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'config.info' in value "${config.info}" 这个错误通常是由于无法解析占位符 'config.info' 导致的。\[1\]在程序中使用自动注入的方式获取值时,可能会遇到这个问题。例如,在代码中使用了 @Autowired 注解来注入依赖的配置信息,但是无法找到对应的占位符值。\[2\]这个问题可能与使用的依赖库有关。在引用\[3\]中提到的情况中,通过修改依赖库的版本,从 'spring-cloud-config-server' 到 'spring-cloud-starter-config',可以解决这个问题。你可以尝试检查你的代码中是否存在未解析的占位符,并确保依赖库的版本正确。 #### 引用[.reference_title] - *1* *3* [Injection of autowired dependencies failednested exception is java.lang.IllegalArgumentException](https://blog.csdn.net/hhb_19930307/article/details/124205887)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Injection of autowired dependencies failednested exception is java.lang.Il](https://blog.csdn.net/weixin_58276266/article/details/123551450)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值