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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   ShardingSphere-Proxy-5.5.1
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   Configure read-write separation + sub-library
   ### Actual behavior
   Startup failed and reported an error
   ### Reason analyze (If you can)
   Configuration file problem
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   **Here is the configuration of my database-sharding.yaml file:**
   
   ```
   databaseName: oj_new
   dataSources:
     oj_user:
       url: 
jdbc:mysql://10.6.30.179:3306/oj_new_user?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&allowMultiQueries=true
       username: root
       password: jsuoj
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
     oj_topic:
       url: 
jdbc:mysql://10.6.30.181:3306/oj_new_topic?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&allowMultiQueries=true
       username: root
       password: jsuoj
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
     oj_exam:
       url: 
jdbc:mysql://10.6.30.182:3306/oj_new_exam?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&allowMultiQueries=true
       username: root
       password: jsuoj
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
     oj_submit_read:
       url: 
jdbc:mysql://10.6.30.180:3306/oj_new_make?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&allowMultiQueries=true
       username: root
       password: jsuoj
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
     oj_submit_write:
       url: 
jdbc:mysql://10.6.30.179:3306/oj_new_make?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&allowMultiQueries=true
       username: root
       password: jsuoj
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
   rules:
   - !READWRITE_SPLITTING
     dataSources:
       readwrite_ds:
         writeDataSourceName: oj_submit_write
         readDataSourceNames:
           - oj_submit_read
         loadBalancerName: random
     loadBalancers:
       random:
         type: RANDOM
   - !SINGLE
     tables: 
       - "*.*"
   ```
   
   After executing ./start.sh, the log file throws an exception:
   
   ```
   Exception in thread "main" Cannot create property=rules for 
JavaBean=org.apache.shardingsphere.proxy.backend.config.yaml.YamlProxyDatabaseConfiguration@226a82c4
    in 'reader', line 19, column 1:
       databaseName: oj_new
       ^
   Cannot create property=tables for 
JavaBean=org.apache.shardingsphere.single.yaml.config.YamlSingleRuleConfiguration@7fe8ea47
    in 'reader', line 60, column 3:
       - !SINGLE
         ^
   No single argument constructor found for interface java.util.Collection
    in 'reader', line 62, column 5:
           "*.*"
           ^
   
    in 'reader', line 60, column 1:
       - !SINGLE
       ^
   
           at 
org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:283)
           at 
org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:169)
           at 
org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:320)
           at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264)
           at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247)
           at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:201)
           at 
org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:185)
           at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:493)
           at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:459)
           at 
org.apache.shardingsphere.infra.util.yaml.YamlEngine.unmarshal(YamlEngine.java:56)
           at 
org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader.loadDatabaseConfiguration(ProxyConfigurationLoader.java:148)
           at 
org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader.loadDatabaseConfigurations(ProxyConfigurationLoader.java:139)
           at 
org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader.load(ProxyConfigurationLoader.java:86)
           at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:60)
   Caused by: Cannot create property=tables for 
JavaBean=org.apache.shardingsphere.single.yaml.config.YamlSingleRuleConfiguration@7fe8ea47
    in 'reader', line 60, column 3:
       - !SINGLE
         ^
   No single argument constructor found for interface java.util.Collection
    in 'reader', line 62, column 5:
           "*.*"
           ^
   
           at 
org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:283)
           at 
org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:169)
           at 
org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:320)
           at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264)
           at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247)
           at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructSequenceStep2(BaseConstructor.java:464)
           at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructSequence(BaseConstructor.java:430)
           at 
org.yaml.snakeyaml.constructor.Constructor$ConstructSequence.construct(Constructor.java:522)
           at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264)
           at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247)
           at 
org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.newInstance(Constructor.java:295)
           at 
org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:260)
           ... 13 more
   ```
   


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