yanzhisishui opened a new issue, #31211:
URL: https://github.com/apache/shardingsphere/issues/31211

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
              <dependency>
                        <groupId>org.apache.shardingsphere</groupId>
                        
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
                        <version>4.1.1</version>
                </dependency>
   
                    SpringBoot  3.2.4
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   SpringBoot  3.2.4
   ### Expected behavior
   Configure the application.yml file according to the document to 
automatically build a sub-table data source.
   ### Actual behavior
   Error when building data source due to code defects
   ### Reason analyze (If you can)
   org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration  
   in this class,
   
    @Bean
       @Conditional(ShardingRuleCondition.class)
       public DataSource shardingDataSource() throws SQLException {
           return ShardingDataSourceFactory.createDataSource(dataSourceMap, new 
ShardingRuleConfigurationYamlSwapper().swap(shardingRule), props.getProps());
       }
   
   This line of code will ultimately call a method to construct the DataSource。
   
   org.apache.shardingsphere.spring.boot.util.DataSourceUtil.callSetterMethod
   
   
![image](https://github.com/apache/shardingsphere/assets/44022031/a178beed-ed7c-461a-a99a-3f93dce9aaa7)
   
   But we can find that there is no such method in HikariDataSource。Therefore, 
a reflection exception will be reported here and the sub-table data source 
cannot be constructed.
   
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to