You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/01/10 01:55:51 UTC

[GitHub] [shardingsphere-elasticjob] 768179367 commented on issue #1799: NoSuchMethodException: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper.()

768179367 commented on issue #1799:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1799#issuecomment-1008484835


   hello, you  can register a bean of TracingConfiguration<DataSource> to cover default DruidDataSourceWrapper
     `  @Bean
       public TracingConfiguration<DataSource> tracingConfiguration(final DataSource dataSource) {
           String className = "com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper";
           if (dataSource.getClass().getName().equals(className)) {
               DruidDataSource originDataSource = (DruidDataSource) dataSource;
               DruidDataSource selfDatasource = new DruidDataSource();
               //   set you datasource config
              selfDatasource.setDriver(originDataSource.getDriver());
              selfDatasource.setUrl(originDataSource.getUrl());
              selfDatasource.setUsername(originDataSource.getUsername());
              selfDatasource.setPassword(originDataSource.getPassword());
               return new TracingConfiguration<>(RDB, selfDatasource);
           }
           return new TracingConfiguration<>(RDB, dataSource);
       }`
   and   ### do not  have any config  in `application.yml`  about tarcing. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org