- yml配置文件无法被加载,修改后系统报错。
配置文件跟换为yml文件后运行报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorldController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'hello1.myname' in value "${hello1.myname}"
以及DataSource等异常。
解决方法:
修改pom文件:
吧**/*.yml文件增加进去
<resources>
。。。
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
<include>**/*.yml</include>
<include>**/*.html</include>
</includes>
<filtering>false</filtering>
</resource>
。。。