一、该问题的重现步骤是什么?
1. 在application.yml中配置多数据库连接:
: : : : : : master : : : com.mysql.cj.jdbc.Driver : root : root : jdbc:mysql://localhost:3306/nems?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8 : : sa : 123456 : com.microsoft.sqlserver.jdbc.SQLServerDriver : jdbc:sqlserver://localhost:1433;databaseName=AssetsData
2. 在service中通DS切换数据源:
(value = ) { ; <> () { <> = .query(, Object[]{}, BeanPropertyRowMapper<>(.)); ; } }
二、你期待的结果是什么?实际看到的又是什么?
使用V2.8.1正常,升级到2.8.2后才报这个错误。
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
使用 blade_boot V2.8.2,运行在Win10企业版。
四、请提供详细的错误堆栈信息,这很重要。
2021-08-21 12:00:00.410 WARN 9448 --- [reate-214436036] c.m.s.jdbc.internals.TDS.Channel : TLSv1 was negotiated. Please update server and client to use TLSv1.2 at minimum.
2021-08-21 12:00:00.412 ERROR 9448 --- [reate-214436036] com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: jdbc:sqlserver://localhost:1433;databaseName=AssetsData, errorCode 0, state null
java.sql.SQLException: validateConnection false
at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1418)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1733)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2801)
Caused by: java.lang.NullPointerException: null
at com.alibaba.druid.wall.WallProvider.checkInternal(WallProvider.java:707)
at com.alibaba.druid.wall.WallProvider.check(WallProvider.java:584)
at com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:826)
at com.alibaba.druid.wall.WallFilter.check(WallFilter.java:821)
at com.alibaba.druid.wall.WallFilter.statement_execute(WallFilter.java:454)
at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:3008)
at com.alibaba.druid.filter.FilterAdapter.statement_execute(FilterAdapter.java:2484)
at com.alibaba.druid.filter.FilterEventAdapter.statement_execute(FilterEventAdapter.java:188)
at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:3008)
at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.execute(StatementProxyImpl.java:147)
at com.alibaba.druid.pool.vendor.MSSQLValidConnectionChecker.isValidConnection(MSSQLValidConnectionChecker.java:50)
at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1398)
... 2 common frames omitted
五、若有更多详细信息,请在下面提供。
扫一扫访问 Blade技术社区 移动端