解决BUG:启动报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean wit

BUG:

Application startup failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘dataSourceController’: Unsatisfied dependency expressed through field ‘aService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘aServiceImpl’: Unsatisfied dependency expressed through field ‘aMapper’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘aMapper’ defined in file [D:\××\AMapper.class]: Cannot resolve reference to bean ‘testSqlSessionTemplate’ while setting bean property ‘sqlSessionTemplate’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dataSourceConfig’: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘myprops.mysql.url’ in value “${myprops.mysql.url}”
在这里插入图片描述

解决方法:检查application配置文件 配置的spring.profiles.active是否为正确格式

正确格式:
在这里插入图片描述

可能的错误形式:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_45752941/article/details/112617430