一、该问题的重现步骤是什么?
我想自己配置数据库密码加密
package org.springblade.common.config; import com.alibaba.druid.pool.DruidDataSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import javax.sql.DataSource; import java.sql.SQLException; @Configuration @ConfigurationProperties(prefix = "spring.datasource") public class DbConfig { private static final Logger LOGGER = LoggerFactory.getLogger(DbConfig.class); private String url; private String driverClassName; private String username; private String password; private Integer initialSize; private Integer minIdle; private Integer maxActive; private Integer maxWait; private Integer timeBetweenEvictionRunsMillis; private Integer minEvictableIdleTimeMillis; private String validationQuery; private Boolean testWhileIdle; private Boolean testOnBorrow; private Boolean testOnReturn; private Boolean poolPreparedStatements; private Integer maxOpenPreparedStatements; private Integer maxPoolPreparedStatementPerConnectionSize; private String filters; private String publicKey; private String connectionProperties; @Primary @Bean(name = "dataSource") public DataSource dataSource() { DruidDataSource datasource = new DruidDataSource(); datasource.setUrl(url); datasource.setUsername(username); datasource.setPassword(password); datasource.setDriverClassName(driverClassName); datasource.setInitialSize(initialSize); datasource.setMinIdle(minIdle); datasource.setMaxActive(maxActive); datasource.setMaxWait(maxWait); datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); datasource.setValidationQuery(validationQuery); datasource.setTestWhileIdle(testWhileIdle); datasource.setTestOnBorrow(testOnBorrow); datasource.setTestOnReturn(testOnReturn); datasource.setPoolPreparedStatements(poolPreparedStatements); datasource.setMaxOpenPreparedStatements(maxOpenPreparedStatements); datasource.setMaxPoolPreparedStatementPerConnectionSize(maxPoolPreparedStatementPerConnectionSize); datasource.setConnectionProperties(connectionProperties); try { datasource.setFilters(filters); } catch (SQLException e) { LOGGER.error("druid configuration initialization filter", e); } return datasource; } gettter 和 setter }
2. 发现错误、
和https://sns.bladex.cn/q-761.html一样
我按照文中建议修改
3.继续提示
我将这个类也加入进去,结果
同样的配置在开源版本是没问题的
二、你期待的结果是什么?实际看到的又是什么?
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
四、请提供详细的错误堆栈信息,这很重要。
五、若有更多详细信息,请在下面提供。
- 消灭零回复
官方新品
- 热议问题
-
使用注解配置数据权限
1
-
服务注册上来了但是报403错误
2
-
有没有办法在blade-tsdb-influxdb2里也能打印日志?因为在blade-tsdb-influxdb2中加了些自己的业务代码
1
-
生成的后端代码,swagger调试直接报空指针 DataScopeModel.getResourceCode()
2
-
项目启动nacos报错,还需要配置什么东西吗
1
-
连接sqlserver数据库,主键自增长,批量保存失败
1
-
服务自定义包名,服务注册成功,但swagger中没有api接口
1
-
partial write: points beyond retention policy dropped=1
1
-
这个框架怎么修改数据库连接池数量
1
-
增加新的驱动类
1
扫一扫访问 Blade技术社区 移动端