Error creating bean with name ‘billRestService‘: Injection of resource dependencies failed

Posted 364.99°

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Error creating bean with name ‘billRestService‘: Injection of resource dependencies failed相关的知识,希望对你有一定的参考价值。

1.bug日志

在搬移一个项目,给它升级springboot版本的时候遇到的,把逻辑代码和依赖搬运并配置了数据源和permitUrl之后,运行报错。

日志报错:
09:27:42.567 [main] ERROR org.springframework.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘billRestService’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘billReadServiceImpl’: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘hipay.conf.billUrl’ in value “$hipay.conf.billUrl”

中文翻译:
创建名为“billRestService”的 bean 时出错:资源依赖注入失败;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建名为“billReadServiceImpl”的 bean 时出错:注入自动装配的依赖项失败;嵌套异常是 java.lang.IllegalArgumentException:无法解析值“hipay.conf.billUrl”中的占位符“hipay.conf.billUrl”

2.解决

其实日志中已经给出了解决方案:在配置文件中配置 hipay.conf.billUrl

所以,我打开yml配置文件,加入该配置字段就OK了

hipay:
  conf:
    billUrl: "xxx"

以上是关于Error creating bean with name ‘billRestService‘: Injection of resource dependencies failed的主要内容,如果未能解决你的问题,请参考以下文章

Error creating bean with name ‘requestMappingHandlerMapping‘

react(85)--error:Error creating bean with name ‘onlineStudyController‘:

Error creating bean with name 'eurekaAutoServiceRegistration'

Spring 报错:Error creating bean with name

Error creating bean with name

Error creating bean with name 'transactionManager'