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 2022/07/02 08:40:58 UTC

[GitHub] [shardingsphere] flyduckforever commented on issue #18759: sharing-proxy start error: java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.shardingsphere.infra.yaml.config.pojo.YamlRuleConfiguration

flyduckforever commented on issue #18759:
URL: https://github.com/apache/shardingsphere/issues/18759#issuecomment-1172862295

   > ### sharind-proxy start error message:
   > `Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.shardingsphere.infra.yaml.config.pojo.YamlRuleConfiguration at org.apache.shardingsphere.infra.yaml.config.swapper.YamlRuleConfigurationSwapperEngine$$Lambda$16/557023567.apply(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.Iterator.forEachRemaining(Iterator.java:116) at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at org.apache.shardingsphere.infra.yaml.config.swapper.YamlRuleConfigurationSwapperEngine.swapTo
 RuleConfigurations(YamlRuleConfigurationSwapperEngine.java:59) at org.apache.shardingsphere.proxy.backend.config.yaml.swapper.YamlProxyConfigurationSwapper.swapDatabaseConfigurations(YamlProxyConfigurationSwapper.java:63) at org.apache.shardingsphere.proxy.backend.config.yaml.swapper.YamlProxyConfigurationSwapper.swap(YamlProxyConfigurationSwapper.java:52) at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:62) at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.init(BootstrapInitializer.java:55) at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:50)`
   > 
   > ### server.xml:
   > `rules: users: - root@%:root - sharding@:sharding provider: type: ALL_PERMITTED
   > 
   > props: max-connections-size-per-query: 1 kernel-executor-size: 16 # Infinite by default. proxy-frontend-flush-threshold: 128 # The default value is 128. proxy-hint-enabled: false sql-show: true sql-simple: true check-table-metadata-enabled: false show-process-list-enabled: false proxy-backend-query-fetch-size: -1 check-duplicate-table-enabled: false proxy-frontend-executor-size: 0 proxy-backend-executor-suitable: OLAP proxy-frontend-max-connections: 0 sql-federation-enabled: false proxy-backend-driver-type: JDBC proxy-mysql-default-version: 5.7.22 proxy-default-port: 3307 proxy-netty-backlog: 1024 `
   > 
   > ### config-sharding.xml:
   > `databaseName: decard_pay_dev
   > 
   > dataSources: ds0: url: jdbc:mysql://127.0.0.1:3306/decard_pay_dev?serverTimezone=UTC&useSSL=false username: root password: root connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50
   > 
   > rules: sharding: tables: dp_trade_payment_order: # 配置数据节点 actual-data-nodes: ds0.dp_trade_payment_order_$->{2020..2025}_0$->{1..4} # 分表策略 table-strategy: complex: sharding-columns: platform_order_no,order_time,pay_success_time sharding-algorithm-name: order-algorithm dp_trade_payment_record: # 配置数据节点 actual-data-nodes: ds0.dp_trade_payment_record_−>2020..20250->{1..4} # 分表策略 table-strategy: complex: sharding-columns: platform_order_no,pay_success_time sharding-algorithm-name: order-algorithm sharding-algorithms: order-algorithm: type: CLASS_BASED props: strategy: COMPLEX algorithmClassName: com.decard.sharding.config.OrderComplexKeysShardingAlgorithm binding-tables: dp_trade_payment_order,dp_trade_payment_record `
   
   finish


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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