异常:Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException

这个异常是出现在注入配置文件中配置好的属性时报错的:

Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘my.name‘ in value "${my.name}"

此时配置文件默认的名称为:application.properties 
解决方法: 
将配置文件名改为:application.yml 
就可以正常启动.

后来又发现如果想让配置文件名称为application.properties 
则需要在配置文件中以: 
xxx.yyy.name的格式来书写需要使用到的属性

时间: 2024-10-05 04:55:55

异常:Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException的相关文章

@Repository 注解引发的异常: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field

手头的项目使用spring mvc+ mybatis框架开发,今天调试时遇到奇怪的问题, biz层的ManagerImpl.java 一直报错: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field.... 逐一检查了Dao层.biz层.service层的文件,

HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: Control character in cookie value or attribute.

1 HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: Control character in cookie value or attribute. 2 type Exception report 3 4 message Request processing failed; nested exception is java.lang.Illega

Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V

启动web应用时出现以下异常: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(A

HTTP Status 500 - Handler processing failed; nested exception is java.lang.OutOfMemoryError: PermGen

HTTP Status 500 - Handler processing failed; nested exception is java.lang.OutOfMemoryError: PermGen space 发生此问题的环境信息: 系统:CentOS 6.5 Tomcat:Tomcat 7.0.6 PermGen space PermGen space的全称是Permanent Generation space,是指内存的永久保存区域OutOfMemoryError: PermGen sp

spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes

spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure

【错误解决】BeanDefinitionStoreException: Failed to read candidate component class: file [mapper.class文件]; nested exception is java.lang.IllegalArgumentException

问题描述: "spring-mybatis整合,使用mapper代理开发,通过MapperScannerConfigurer进行mapper扫描"的练习中,出现异常: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [E:\项目\mybatis_spring\bin\cn\itheima\ssm\mapper\Us

Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.apache.commons.codec.digest.DigestUtils.sha1Hex(Ljava/lang/String;)Ljava/lang/String;

异常:Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.apache.commons.codec.digest.DigestUtils.sha1Hex(Ljava/lang/String;)Ljava/lang/String; 一般是jar包冲突,造成Java对象找到多个相同方法或变量不知道哪个正确,或者是直接找不到正确的可使用的,才会报出类似的错误, 回头想一想刚才修改了pom文件中哪

spring quartz:Instantiation of bean failed; nested exception is java.lang.IncompatibleClassChangeErr

spring 调度类初始化失败,分析是jar包冲突,日志如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scheduler' defined in file [D:\InstallApplication\apache-tomcat-7.0.23\wtpwebapps\campaign\WEB-INF\classes\spring\applicationConte

HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException

type Exception report message Request processing failed; nested exception is java.lang.NullPointerException description The server encountered an internal error that prevented it from fulfilling this request. exception org.springframework.web.util.Ne