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 2020/12/03 02:25:17 UTC

[GitHub] [shardingsphere] liguobao666 opened a new issue #8479: 5.0 java.util.NoSuchElementException: No value bound

liguobao666 opened a new issue #8479:
URL: https://github.com/apache/shardingsphere/issues/8479


   
   ```
   spring.shardingsphere.datasource.names=primary_ds,replica_ds_0,replica_ds_1
   
   spring.shardingsphere.datasource.common.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.common.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.common.username=root
   spring.shardingsphere.datasource.common.password=123456
   
   spring.shardingsphere.datasource.primary_ds.jdbc-url=jdbc:mysql://localhost:3306/ds0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
   
   spring.shardingsphere.datasource.replica_ds_0.jdbc-url=jdbc:mysql://localhost:3306/ds1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
   
   spring.shardingsphere.datasource.replica_ds_1.jdbc-url=jdbc:mysql://localhost:3306/ds2?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
   
   spring.shardingsphere.rules.replica-query.load-balancers.round-robin.type=ROUND_ROBIN
   spring.shardingsphere.rules.replica-query.data-sources.pr_ds.primary-data-source-name=primary_ds
   spring.shardingsphere.rules.replica-query.data-sources.pr_ds.replica-data-source-names=replica_ds_0,replica_ds_1
   spring.shardingsphere.rules.replica-query.data-sources.pr_ds.load-balancer-name=round_robin
   
   ```
   `
   <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
               <version>5.0.0-alpha</version>
    </dependency>
   `


----------------------------------------------------------------
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] yu199195 commented on issue #8479: 5.0 java.util.NoSuchElementException: No value bound

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


   @liguobao666  hi, if you use springboot, you should use '-' , like this :
   
   ```
   pr-ds
   ```
   
   of course ,you will see  #8459 
   
   


----------------------------------------------------------------
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] yu199195 edited a comment on issue #8479: 5.0 java.util.NoSuchElementException: No value bound

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


   @liguobao666  hi, if you use springboot, you should use '-' , like this :
   
   ```
   pr-ds
   ```
   
   and then you will config this  
   ```
   spring.shardingsphere.rules.replica-query.load-balancers.round-robin.props.workId=123456
   
   ```
   
   of course ,you will see  #8459 
   
   


----------------------------------------------------------------
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] liguobao666 commented on issue #8479: 5.0 java.util.NoSuchElementException: No value bound

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


   Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
   	at org.springframework.util.ReflectionUtils.rethrowRuntimeException(ReflectionUtils.java:147)
   	at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:810)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
   	at com.ligb.shard.AccountApplication.main(AccountApplication.java:14)
   Caused by: java.lang.reflect.InvocationTargetException
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.apache.shardingsphere.spring.boot.util.PropertyUtil.v2(PropertyUtil.java:111)
   	at org.apache.shardingsphere.spring.boot.util.PropertyUtil.handle(PropertyUtil.java:75)
   	at org.apache.shardingsphere.spring.boot.registry.AbstractAlgorithmProvidedBeanRegistry.lambda$registerBean$1(AbstractAlgorithmProvidedBeanRegistry.java:57)
   	at java.lang.Iterable.forEach(Iterable.java:75)
   	at org.apache.shardingsphere.spring.boot.registry.AbstractAlgorithmProvidedBeanRegistry.registerBean(AbstractAlgorithmProvidedBeanRegistry.java:55)
   	at org.apache.shardingsphere.replicaquery.spring.boot.algorithm.ReplicaQueryAlgorithmProvidedBeanRegistry.postProcessBeanDefinitionRegistry(ReplicaQueryAlgorithmProvidedBeanRegistry.java:43)
   	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
   	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:125)
   	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706)
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
   	... 3 more
   Caused by: java.util.NoSuchElementException: No value bound
   	at org.springframework.boot.context.properties.bind.BindResult.get(BindResult.java:56)
   	... 21 more
   Disconnected from the target VM, address: '127.0.0.1:51831', transport: 'socket'
   
   Process finished with exit code 1
   


----------------------------------------------------------------
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] yu199195 closed issue #8479: 5.0 java.util.NoSuchElementException: No value bound

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


   


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