menghaoranss opened a new issue #11921:
URL: https://github.com/apache/shardingsphere/issues/11921


   ## 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?
   5.0.0-RC1-SNAPSHOT
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   example
   
   ### Expected behavior
   run successfully
   
   ### Actual behavior
   ```
   Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration.setDataSourceField(DataSourceConfiguration.java:139)
        at 
org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:127)
        at 
org.apache.shardingsphere.governance.context.ClusterContextManagerBuilder.createDataSources(ClusterContextManagerBuilder.java:169)
        at 
org.apache.shardingsphere.governance.context.ClusterContextManagerBuilder.getChangedDataSources(ClusterContextManagerBuilder.java:161)
        at 
org.apache.shardingsphere.governance.context.ClusterContextManagerBuilder.loadDataSourcesMap(ClusterContextManagerBuilder.java:114)
        at 
org.apache.shardingsphere.governance.context.ClusterContextManagerBuilder.build(ClusterContextManagerBuilder.java:71)
        at 
org.apache.shardingsphere.driver.governance.internal.datasource.GovernanceShardingSphereDataSource.<init>(GovernanceShardingSphereDataSource.java:65)
        at 
org.apache.shardingsphere.driver.governance.api.yaml.YamlGovernanceShardingSphereDataSourceFactory.createDataSourceWithoutRules(YamlGovernanceShardingSphereDataSourceFactory.java:114)
        at 
org.apache.shardingsphere.driver.governance.api.yaml.YamlGovernanceShardingSphereDataSourceFactory.createDataSource(YamlGovernanceShardingSphereDataSourceFactory.java:107)
        at 
org.apache.shardingsphere.driver.governance.api.yaml.YamlGovernanceShardingSphereDataSourceFactory.createDataSource(YamlGovernanceShardingSphereDataSourceFactory.java:58)
        at 
org.apache.shardingsphere.example.governance.raw.jdbc.GovernanceRawYamlConfigurationExample.getDataSource(GovernanceRawYamlConfigurationExample.java:64)
        at 
org.apache.shardingsphere.example.governance.raw.jdbc.GovernanceRawYamlConfigurationExample.main(GovernanceRawYamlConfigurationExample.java:51)
   Caused by: java.lang.IllegalArgumentException: minimumIdle cannot be negative
        at com.zaxxer.hikari.HikariConfig.setMinimumIdle(HikariConfig.java:266)
        ... 16 more
   
   ```
   
   ### Reason analyze (If you can)
   
   ShardingSphere persist `minimumIdle` of  HikariDataSource as `-1` to the 
registry center when starting with local configurations.
   
   ```
   ds_1:
     schema: null
     transactionIsolation: null
     initializationFailTimeout: 1
     validationTimeout: 5000
     catalog: null
     maxLifetime: 1800000
     leakDetectionThreshold: 0
     connectionInitSql: null
     minimumIdle: -1 # focus on here
     password: root123456
     dataSourceJNDI: null
     connectionTestQuery: null
     idleTimeout: 600000
     driverClassName: com.mysql.jdbc.Driver
     jdbcUrl: 
jdbc:mysql://localhost:3306/ds_2?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     maximumPoolSize: -1
     connectionTimeout: 30000
     username: root
     poolName: null
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   Search `GovernanceRawYamlConfigurationExample.java`
   1. run with `loadConfigFromRegCenter = false`
   2. run with `loadConfigFromRegCenter = false`
   
   ### 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