You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "FlyingZC (via GitHub)" <gi...@apache.org> on 2023/02/06 11:41:46 UTC
[GitHub] [shardingsphere] FlyingZC opened a new issue, #24028: Start failed with -f parameter
FlyingZC opened a new issue, #24028:
URL: https://github.com/apache/shardingsphere/issues/24028
## Bug Report
Start failed with -f parameter
### Which version of ShardingSphere did you use?
master
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
proxy
### Expected behavior
Start successfully with -f parameter when the data source is unavailable.
### Actual behavior
Start failed.
```
Exception in thread "main" java.lang.NullPointerException
at org.apache.shardingsphere.transaction.xa.jta.datasource.XATransactionDataSource.<init>(XATransactionDataSource.java:68)
at org.apache.shardingsphere.transaction.xa.XAShardingSphereTransactionManager.newXATransactionDataSource(XAShardingSphereTransactionManager.java:79)
at org.apache.shardingsphere.transaction.xa.XAShardingSphereTransactionManager.lambda$init$0(XAShardingSphereTransactionManager.java:65)
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
at org.apache.shardingsphere.transaction.xa.XAShardingSphereTransactionManager.init(XAShardingSphereTransactionManager.java:65)
at org.apache.shardingsphere.transaction.ShardingSphereTransactionManagerEngine.lambda$init$0(ShardingSphereTransactionManagerEngine.java:64)
at java.util.Map.forEach(Map.java:630)
at org.apache.shardingsphere.transaction.ShardingSphereTransactionManagerEngine.init(ShardingSphereTransactionManagerEngine.java:64)
at org.apache.shardingsphere.transaction.rule.TransactionRule.createTransactionManagerEngine(TransactionRule.java:81)
at org.apache.shardingsphere.transaction.rule.TransactionRule.<init>(TransactionRule.java:63)
at org.apache.shardingsphere.transaction.rule.builder.TransactionRuleBuilder.build(TransactionRuleBuilder.java:36)
at org.apache.shardingsphere.transaction.rule.builder.TransactionRuleBuilder.build(TransactionRuleBuilder.java:32)
at org.apache.shardingsphere.infra.rule.builder.global.GlobalRulesBuilder.buildRules(GlobalRulesBuilder.java:54)
at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:92)
at org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder.build(ClusterContextManagerBuilder.java:78)
at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:82)
at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.init(BootstrapInitializer.java:62)
at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:53)
```
### Reason analyze (If you can)
`ShardingSphereResourceMetaData#createStorageTypes` uses `DataSourceStateManager.getInstance().getEnabledDataSourceMap` to filter the enabeld dataSources,when `ds_0` is unavailable, the storage type of `ds_0` will be null and results in a null pointer exception.
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
```yaml
databaseName: sharding_db
dataSources:
ds_0:
url: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
username: root
password: x
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
ds_1:
url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
username: root
password: root
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
```
Config the `ds_0` with the incorrect password and start proxy by -f parameter.
### Example codes for reproduce this issue (such as a github link).
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu closed issue #24028: Start failed with -f parameter
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu closed issue #24028: Start failed with -f parameter
URL: https://github.com/apache/shardingsphere/issues/24028
--
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