Sherlock-4869 commented on issue #24880:
URL: 
https://github.com/apache/shardingsphere/issues/24880#issuecomment-1489600434

   Sorry to bother you again , I have upgrade to version 5.3.0.
   
   But I have encountered a new problem, when I start up the project , it 
reported exception 
   
   ```
   Caused by: org.yaml.snakeyaml.error.YAMLException: No single argument 
constructor found for interface 
org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlRuleConfiguration
   ```
   
   there is my configuration
   
   I will reject a datasource like this 
   ```
   package com.hgny.energy.datasources;
   
   import 
org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
   import org.springframework.context.annotation.Bean;
   import org.springframework.context.annotation.Configuration;
   import org.springframework.context.annotation.Primary;
   
   import javax.sql.DataSource;
   import java.io.IOException;
   import java.sql.SQLException;
   
   import static org.springframework.util.ResourceUtils.getFile;
   
   @Configuration
   public class ShardingDataSource {
   
        @Bean
        @Primary
        DataSource shardingSphereDataSource() throws SQLException, IOException {
                return YamlShardingSphereDataSourceFactory.createDataSource(
                                getFile("classpath:sharding.yaml"));
        }
   }
   
   ```
   
   and my application-dev.yml is 
   
   ```
   spring:
     datasource:
       driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
       url: jdbc:shardingsphere:classpath:sharding.yaml
   ```
   
   and my sharding.yaml is 
   
   ```
   dataSources:
     ds0:
       dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
       driverClassName: com.mysql.cj.jdbc.Driver
       url: 
"jdbc:mysql://172.18.100.87:3306/eeyes_energy?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT"
       username: root
       password: hgny
       initial-size: 10
       max-active: 100
       min-idle: 10
       max-wait: 60000
       pool-prepared-statements: true
       max-pool-prepared-statement-per-connection-size: 20
       time-between-eviction-runs-millis: 60000
       min-evictable-idle-time-millis: 300000
       test-while-idle: true
       test-on-borrow: false
       test-on-return: false
       stat-view-servlet:
         enabled: true
         url-pattern: /druid/*
       filter:
         stat:
           log-slow-sql: true
           slow-sql-millis: 1000
           merge-sql: false
         wall:
           config:
             multi-statement-allow: true
   
   rules:
     sharding:
       tables:
         data_energy_15min:
           actual-data-nodes: 
ds0.data_energy_15min_$->{2020..2030}${(1..12).collect{t->t.toString().padLeft(2,'0')}}
           table-strategy:
             standard:
               sharding-column: stat_date_time
               sharding-algorithm-name: dateTime
       sharding-algorithms:
         dateTime:
           type: CLASS_BASED
           props:
             strategy: STANDARD
             algorithmClassName: 
com.hgny.energy.module.data.sharding.StatTimeShardingAlgorithm
   props:
     sql-show: true
   ```
   
   Can you see what the problem is?please
   


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