/ 详情

ShardingSphere Proxy启动报错,官网下载的最新版

Backlog
Opened this issue  
2021-05-27 11:47

config-sharding.yaml如下:
schemaName: sharding_db
dataSources:
ds0:
url: jdbc:mysql://192.168.3.113:3306/ms1?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
username: root
password: 123456
connectionTimeoutMilliseconds: 18000
idleTimeoutMilliseconds: 18000
maxLifetimeMilliseconds: 18000
maxPoolSize: 50
minPoolSize: 1

rules:
tables:
xf_acctransdetail:
actualDataNodes: ds0.av_tal_${2021..2022}0${1..9},ds0.av_tal${2021..2022}${10..12}
logicTable: xf_acctransdetail
tableStrategy:
standard:
preciseAlgorithmClassName: org.xxx.config.CusPreciseShardingAlgorithm
rangeAlgorithmClassName: org.xxx.config.CusStringRangShardingAlgorithm
shardingColumn: s_time
bindingTables:
- av_tal
defaultDatabaseStrategy:
standard:
shardingColumn: id
shardingAlgorithmName: database_inline
defaultTableStrategy:
none:
shardingAlgorithms:
database_inline:
type: INLINE
props:
algorithm-expression: ds0
${id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker-id: 123

~

报错信息如下:
Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.shardingsphere.infra.yaml.config.YamlRuleConfiguration
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:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
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.swapper.YamlRuleConfigurationSwapperEngine.swapToRuleConfigurations(YamlRuleConfigurationSwapperEngine.java:66)
at org.apache.shardingsphere.proxy.config.yaml.swapper.YamlProxyConfigurationSwapper.lambda$getRuleConfigurations$0(YamlProxyConfigurationSwapper.java:59)
at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1321)
at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
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:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
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.proxy.config.yaml.swapper.YamlProxyConfigurationSwapper.getRuleConfigurations(YamlProxyConfigurationSwapper.java:58)
at org.apache.shardingsphere.proxy.config.yaml.swapper.YamlProxyConfigurationSwapper.swap(YamlProxyConfigurationSwapper.java:50)
at org.apache.shardingsphere.proxy.initializer.impl.StandardBootstrapInitializer.getProxyConfiguration(StandardBootstrapInitializer.java:33)
at org.apache.shardingsphere.proxy.initializer.impl.AbstractBootstrapInitializer.init(AbstractBootstrapInitializer.java:62)
at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:48)
Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.shardingsphere.infra.yaml.config.YamlRuleConfiguration
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:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
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.swapper.YamlRuleConfigurationSwapperEngine.swapToRuleConfigurations(YamlRuleConfigurationSwapperEngine.java:66)
at org.apache.shardingsphere.proxy.config.yaml.swapper.YamlProxyConfigurationSwapper.lambda$getRuleConfigurations$0(YamlProxyConfigurationSwapper.java:59)
at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1321)
at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
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:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
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.proxy.config.yaml.swapper.YamlProxyConfigurationSwapper.getRuleConfigurations(YamlProxyConfigurationSwapper.java:58)
at org.apache.shardingsphere.proxy.config.yaml.swapper.YamlProxyConfigurationSwapper.swap(YamlProxyConfigurationSwapper.java:50)
at org.apache.shardingsphere.proxy.initializer.impl.StandardBootstrapInitializer.getProxyConfiguration(StandardBootstrapInitializer.java:33)
at org.apache.shardingsphere.proxy.initializer.impl.AbstractBootstrapInitializer.init(AbstractBootstrapInitializer.java:62)
at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:48)
Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.shardingsphere.infra.yaml.config.YamlRuleConfiguration
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:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
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.swapper.YamlRuleConfigurationSwapperEngine.swapToRuleConfigurations(YamlRuleConfigurationSwapperEngine.java:66)
at org.apache.shardingsphere.proxy.config.yaml.swapper.YamlProxyConfigurationSwapper.lambda$getRuleConfigurations$0(YamlProxyConfigurationSwapper.java:59)
at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1321)
at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
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:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
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.proxy.config.yaml.swapper.YamlProxyConfigurationSwapper.getRuleConfigurations(YamlProxyConfigurationSwapper.java:58)
at org.apache.shardingsphere.proxy.config.yaml.swapper.YamlProxyConfigurationSwapper.swap(YamlProxyConfigurationSwapper.java:50)
at org.apache.shardingsphere.proxy.initializer.impl.StandardBootstrapInitializer.getProxyConfiguration(StandardBootstrapInitializer.java:33)
at org.apache.shardingsphere.proxy.initializer.impl.AbstractBootstrapInitializer.init(AbstractBootstrapInitializer.java:62)
at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:48)
Exception in thread "main" java.lang.NullPointerException
at org.apache.shardingsphere.infra.metadata.model.physical.model.table.PhysicalTableMetaDataLoader.load(PhysicalTableMetaDataLoader.java:50)
at org.apache.shardingsphere.sharding.metadata.ShardingMetaDataLoader.load(ShardingMetaDataLoader.java:84)
at org.apache.shardingsphere.sharding.metadata.ShardingMetaDataLoader.load(ShardingMetaDataLoader.java:67)
at org.apache.shardingsphere.sharding.metadata.ShardingMetaDataLoader.load(ShardingMetaDataLoader.java:55)
at org.apache.shardingsphere.infra.metadata.model.logic.LogicSchemaMetaDataLoader.load(LogicSchemaMetaDataLoader.java:72)
at org.apache.shardingsphere.infra.context.schema.SchemaContextsBuilder.createMetaData(SchemaContextsBuilder.java:108)
at org.apache.shardingsphere.infra.context.schema.SchemaContextsBuilder.createSchema(SchemaContextsBuilder.java:102)
at org.apache.shardingsphere.infra.context.schema.SchemaContextsBuilder.build(SchemaContextsBuilder.java:93)
at org.apache.shardingsphere.proxy.initializer.impl.AbstractBootstrapInitializer.createSchemaContexts(AbstractBootstrapInitializer.java:75)
at org.apache.shardingsphere.proxy.initializer.impl.AbstractBootstrapInitializer.init(AbstractBootstrapInitializer.java:63)
at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:48)

Comments (0)

展开全部操作日志

Sign in to comment

状态
Assignees
Milestones
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(1)
572874 yuxuanxinchen 1578928032