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 2021/05/29 08:26:21 UTC

[GitHub] [shardingsphere] zjcnb opened a new issue #10543: [Examples] shardingsphere-jdbc-example test report issue #10519

zjcnb opened a new issue #10543:
URL: https://github.com/apache/shardingsphere/issues/10543


   - encrypt-raw-jdbc-example **fail** 
   `Exception in thread "main" org.apache.shardingsphere.infra.config.exception.ShardingSphereConfigurationException: Incorrect configuration item: the property password of the dataSource, because argument type mismatch
     at org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:122)
     at org.apache.shardingsphere.infra.config.datasource.DataSourceConverter.lambda$getDataSourceMap$0(DataSourceConverter.java:43)
     at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1321)
     at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
     at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699)
     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
     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.config.datasource.DataSourceConverter.getDataSourceMap(DataSourceConverter.java:42)
     at org.apache.shardingsphere.infra.yaml.swapper.YamlDataSourceConfigurationSwapper.swapToDataSources(YamlDataSourceConfigurationSwapper.java:44)
     at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:56)
     at org.apache.shardingsphere.example.encrypt.table.raw.jdbc.YamlConfigurationExampleMain.main(YamlConfigurationExampleMain.java:34)`
   
   - encrypt-spring-boot-example  **pass**
   
   - encrypt-spring-namespace-example  **pass**
   
   - hint-raw-jdbc-example   **fail**
   `Exception in thread "main" org.apache.shardingsphere.infra.config.exception.ShardingSphereConfigurationException: Incorrect configuration item: the property password of the dataSource, because argument type mismatch
     at org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:122)
     at org.apache.shardingsphere.infra.config.datasource.DataSourceConverter.lambda$getDataSourceMap$0(DataSourceConverter.java:43)
     at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1321)
     at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
     at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699)
     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
     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.config.datasource.DataSourceConverter.getDataSourceMap(DataSourceConverter.java:42)
     at org.apache.shardingsphere.infra.yaml.swapper.YamlDataSourceConfigurationSwapper.swapToDataSources(YamlDataSourceConfigurationSwapper.java:44)
     at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:56)
     at org.apache.shardingsphere.example.hint.raw.jdbc.ExampleMain.getDataSource(ExampleMain.java:49)
     at org.apache.shardingsphere.example.hint.raw.jdbc.ExampleMain.main(ExampleMain.java:39)`


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

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



[GitHub] [shardingsphere] zjcnb commented on issue #10543: [Examples] shardingsphere-jdbc-example test report issue

Posted by GitBox <gi...@apache.org>.
zjcnb commented on issue #10543:
URL: https://github.com/apache/shardingsphere/issues/10543#issuecomment-850795803


   My database password is a number and the YAML configuration is automatically converted to INTEGER when loaded. But to set the password, the required parameter type is String
   
   `   public DataSource createDataSource() {
           DataSource result = (DataSource) Class.forName(dataSourceClassName).getConstructor().newInstance();
           Method[] methods = result.getClass().getMethods();
           for (Entry<String, Object> entry : props.entrySet()) {
               if (SKIPPED_PROPERTY_NAMES.contains(entry.getKey())) {
                   continue;
               }
               try {
                   Optional<Method> setterMethod = findSetterMethod(methods, entry.getKey());
                   if (setterMethod.isPresent()) {
                       setterMethod.get().invoke(result, entry.getValue());
                   }
               } catch (final IllegalArgumentException ex) {
                   throw new ShardingSphereConfigurationException("Incorrect configuration item: the property %s of the dataSource, because %s", entry.getKey(), ex.getMessage());
               }
           }
           Optional<JDBCParameterDecorator> decorator = findJDBCParameterDecorator(result);
           return decorator.isPresent() ? decorator.get().decorate(result) : result;
       } `
   


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

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



[GitHub] [shardingsphere] zjcnb closed issue #10543: [Examples] shardingsphere-jdbc-example test report issue

Posted by GitBox <gi...@apache.org>.
zjcnb closed issue #10543:
URL: https://github.com/apache/shardingsphere/issues/10543


   


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

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



[GitHub] [shardingsphere] zjcnb closed issue #10543: [Examples] shardingsphere-jdbc-example test report issue

Posted by GitBox <gi...@apache.org>.
zjcnb closed issue #10543:
URL: https://github.com/apache/shardingsphere/issues/10543


   


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

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



[GitHub] [shardingsphere] zjcnb edited a comment on issue #10543: [Examples] shardingsphere-jdbc-example test report issue

Posted by GitBox <gi...@apache.org>.
zjcnb edited a comment on issue #10543:
URL: https://github.com/apache/shardingsphere/issues/10543#issuecomment-850795803


   My database password is a number and the YAML configuration is automatically converted to INTEGER when loaded. But to set the password, the required parameter type are String
   
   


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

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