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 2021/06/23 08:03:40 UTC

[GitHub] [shardingsphere] fenglex opened a new issue #10937: shardingsphere-jdbc-core-spring-boot-starter 无法启动问题

fenglex opened a new issue #10937:
URL: https://github.com/apache/shardingsphere/issues/10937


   使用以下配置项启动shardingsphere-jdbc-core-spring-boot-starter  
   
   使用shardingsphere-jdbc-core-spring-boot-starter 版本是5.0.0-beta
   spring-boot版本是2.5.0
   ```
   spring:
     shardingsphere:
       props:
         sql-show: true
       datasource:
         common:
           driver-class-name: com.mysql.jdbc.Driver
         names: ds
         ds:
           jdbc-url: jdbc:mysql://hk:3306/db_sharding
           username: root
           driver-class-name: com.mysql.jdbc.Driver
           password: 'nQCk'
           type: com.zaxxer.hikari.HikariDataSource
       rules:
         sharding:
           sharding-algorithms:
             table-inline:
               # 使用了内置的分片算法-INLINE
               type: HASH_MOD
               props:
                 sharding-count: 5
             database-inline:
               type: INLINE
               props:
                 algorithm-expression: ds
           tables:
             tb_data_value:
               actual-data-nodes: ds.tb_data_value$->{0..4}
               table-strategy:
                 standard:
                   sharding-column: data_code
                   sharding-algorithm-name: table-inline
               database-strategy:
                 standard:
                   sharding-column: id
                   sharding-algorithm-name: database-inline
       enabled: true
   ```
   发现问题是因为使用yaml配置文件配置后,sharding-count在HashModShardingAlgorithm类中getShardingCount方法时this.props.getProperty("sharding-count")取到的值实际是null,因为yaml的 sharding-count的类型成了integer类型造成的,希望能修复这个问题


-- 
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.

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



[GitHub] [shardingsphere] strongduanmu closed issue #10937: shardingsphere-jdbc-core-spring-boot-starter 无法启动问题

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #10937:
URL: https://github.com/apache/shardingsphere/issues/10937


   


-- 
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.

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



[GitHub] [shardingsphere] strongduanmu commented on issue #10937: shardingsphere-jdbc-core-spring-boot-starter 无法启动问题

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #10937:
URL: https://github.com/apache/shardingsphere/issues/10937#issuecomment-866648213


   @fenglex For english only, other language will not be accept.


-- 
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.

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