错误信息
Failed to bind properties under 'spring.datasource' to javax.sql.DataSource
问题定位
在 Spring Boot
程序中如果使用了 Druid
的 filters
过滤器选项,如:
filters: stat,wall,log4j
需要在 filters
上加上 log4j
过滤器的同时,还需要在 Spring Boot
工程的 pom
文件中引入 log4j
的依赖。
解决
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>