Spring Boot @Value和@ConfigurationProperties(prefix ="spring.datasource" )注解属性值无法赋值结果为null的情况

原因我在配置文件配置了如下的Bean所导致的,删除就好,原理还不知

/*
//mapper接口扫描器
@Bean
public MapperScannerConfigurer mapperScannerConfigurer(){
MapperScannerConfigurer mapperScannerConfigurer=new MapperScannerConfigurer();
//mapper接口所在的包
mapperScannerConfigurer.setBasePackage(“com.yiche.spingcloudapigateway.mapper”);

    return mapperScannerConfigurer;
}*/

你可能感兴趣的:(错误总结)