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/03/19 04:10:06 UTC

[GitHub] [shardingsphere] 15898317421 opened a new issue #9741: Caused by: java.util.NoSuchElementException: No value bound

15898317421 opened a new issue #9741:
URL: https://github.com/apache/shardingsphere/issues/9741


   **properties**
   server.port=8080
   spring.application.name=dynamic-datasource-sharding-spring
   
   spring.shardingsphere.props.show-sql=true
   
   spring.shardingsphere.datasource.names=ds0
   
   spring.shardingsphere.datasource.ds0.type=com.zaxxer.hikari.HikariDataSource
   spring.shardingsphere.datasource.ds0.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.ds0.jdbc-url=jdbc:mysql://localhost:3316/demo1
   spring.shardingsphere.datasource.ds0.username=root
   spring.shardingsphere.datasource.ds0.password=123456
   
   spring.shardingsphere.sharding.tables.demo_one.actual-data-nodes = ds${0}.demo_one_${0..1}
   spring.shardingsphere.sharding.tables.demo_one.table-strategy.inline.sharding-column = sharding_id
   spring.shardingsphere.sharding.tables.demo_one.table-strategy.inline.algorithm-expression = demo_one_${sharding_id % 2}
   spring.shardingsphere.sharding.tables.demo_one.key-generator.column = sharding_id
   spring.shardingsphere.sharding.tables.demo_one.key-generator.type = SNOWFLAKE
   
   I want to use sharding-jdbc-core-spring-boot-starter for table sharding, because some application already use in pro env with 4.0.0 version.
   And now, I want to implement some compopents for business users with 5.0.0-alpha version, because I want to use the feature of shadow pressure. But it has throw exception. I need help.


-- 
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] huanghao495430759 commented on issue #9741: Caused by: java.util.NoSuchElementException: No value bound

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


   Hi @15898317421 ,it is
    `spring.shardingsphere.props.sql-show=true` 
   not 
   `spring.shardingsphere.props.show-sql=true`


-- 
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] 15898317421 commented on issue #9741: Caused by: java.util.NoSuchElementException: No value bound

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


   In addtion, if I want to combine use the sharding and spring class AbstractRoutingDataSource, the sharing table is not work.
   Can you help me?
   
   import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
   
   public class PtsDynamicRoutingDataSource extends AbstractRoutingDataSource {
       @Override
       protected Object determineCurrentLookupKey() {
           return "ds0";
       }
   }
   
   import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
   import org.apache.ibatis.plugin.Interceptor;
   import org.apache.ibatis.session.SqlSessionFactory;
   import org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.ShardingDataSource;
   import org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration;
   import org.springframework.beans.BeansException;
   import org.springframework.beans.factory.annotation.Qualifier;
   import org.springframework.boot.autoconfigure.AutoConfigureAfter;
   import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
   import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
   import org.springframework.context.ApplicationContext;
   import org.springframework.context.ApplicationContextAware;
   import org.springframework.context.annotation.Bean;
   import org.springframework.context.annotation.Configuration;
   import org.springframework.context.annotation.Primary;
   import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
   import org.springframework.jdbc.datasource.DataSourceTransactionManager;
   import org.springframework.transaction.PlatformTransactionManager;
   
   import javax.sql.DataSource;
   import java.util.HashMap;
   import java.util.Map;
   
   @ConditionalOnProperty(prefix = "pts.datasource", name = "enabled", havingValue = "true", matchIfMissing = true)
   @Configuration
   @AutoConfigureAfter({DataSourceAutoConfiguration.class, SpringBootConfiguration.class})
    public class PtsDataSourceAutoConfiguration implements ApplicationContextAware {
   
       private ApplicationContext applicationContext;
   
       @Override
       public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
           this.applicationContext = applicationContext;
       }
   
       @Bean
       @Primary
       public DataSource dynamicDataSource(){
           PtsDynamicRoutingDataSource dynamicDataSource = new PtsDynamicRoutingDataSource();
           ShardingDataSource ds0 = applicationContext.getBean(org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.ShardingDataSource.class);
           Map<Object, Object> dataSourceMap = new HashMap<>();
           ds0.getDataSourceMap().entrySet().stream().forEach(e -> dataSourceMap.put(e.getKey(), e.getValue()));
           dynamicDataSource.setTargetDataSources(dataSourceMap);
           return dynamicDataSource;
       }
   
       @Bean
       public SqlSessionFactory sqlSessionFactory(@Qualifier("dynamicDataSource") DataSource dynamicDataSource, Interceptor... plugins) throws Exception {
           MybatisSqlSessionFactoryBean sqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();
           sqlSessionFactoryBean.setDataSource(dynamicDataSource);
           sqlSessionFactoryBean.setPlugins(plugins);
   //        sqlSessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResource("classpath:mapper/*.xml"));
           return sqlSessionFactoryBean.getObject();
       }
   
       @Bean
       public PlatformTransactionManager transactionManager(DataSource dynamicDataSource) {
           return new DataSourceTransactionManager(dynamicDataSource);
       }
   }
   
   2021-03-23 11:28:20 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ SpringApplication.java:675 ] [ logStartupProfileInfo ] [ - ] [ - ] [ - ] - No active profile set, falling back to default profiles: default
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ GenericScope.java:295 ] [ setSerializationId ] [ - ] [ - ] [ - ] - BeanFactory id=ace04a46-de6e-326d-a0d6-557fedcdd543
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'stringToNoneShardingStrategyConfigurationConverter' of type [org.apache.shardingsphere.spring.boot.converter.StringToNoneShardingStrategyConfigurationConverter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'spring.shardingsphere.sharding-org.apache.shardingsphere.shardingjdbc.spring.boot.sharding.SpringBootShardingRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.sharding.SpringBootShardingRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'spring.shardingsphere.masterslave-org.apache.shardingsphere.shardingjdbc.spring.boot.masterslave.SpringBootMasterSlaveRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.masterslave.SpringBootMasterSlaveRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'spring.shardingsphere.encrypt-org.apache.shardingsphere.shardingjdbc.spring.boot.encrypt.SpringBootEncryptRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.encrypt.SpringBootEncryptRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'spring.shardingsphere.shadow-org.apache.shardingsphere.shardingjdbc.spring.boot.shadow.SpringBootShadowRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.shadow.SpringBootShadowRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'spring.shardingsphere-org.apache.shardingsphere.shardingjdbc.spring.boot.common.SpringBootPropertiesConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.common.SpringBootPropertiesConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$9744e1ae] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$353fa55] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$1f6dfd52] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ TomcatWebServer.java:90 ] [ initialize ] [ - ] [ - ] [ - ] - Tomcat initialized with port(s): 8080 (http)
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Initializing ProtocolHandler ["http-nio-8080"]
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Starting service [Tomcat]
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Starting Servlet engine: [Apache Tomcat/9.0.36]
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/Users/raistlin/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Initializing Spring embedded WebApplicationContext
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ServletWebServerApplicationContext.java:296 ] [ prepareWebApplicationContext ] [ - ] [ - ] [ - ] - Root WebApplicationContext: initialization completed in 2083 ms
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ HikariDataSource.java:110 ] [ getConnection ] [ - ] [ - ] [ - ] - HikariPool-1 - Starting...
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ HikariDataSource.java:123 ] [ getConnection ] [ - ] [ - ] [ - ] - HikariPool-1 - Start completed.
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ConfigurationLogger.java:104 ] [ log ] [ - ] [ - ] [ - ] - ShardingRuleConfiguration:
   tables:
     demo_one:
       actualDataNodes: ds${0}.demo_one_${0..1}
       keyGenerator:
         column: sharding_id
         type: SNOWFLAKE
       logicTable: demo_one
       tableStrategy:
         inline:
           algorithmExpression: demo_one_${sharding_id % 2}
           shardingColumn: sharding_id
   
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ConfigurationLogger.java:104 ] [ log ] [ - ] [ - ] [ - ] - Properties:
   sql-show: 'true'
   
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ShardingMetaDataLoader.java:131 ] [ loadShardingSchemaMetaData ] [ - ] [ - ] [ - ] - Loading 1 logic tables' meta data.
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ SchemaMetaDataLoader.java:70 ] [ load ] [ - ] [ - ] [ - ] - Loading 2 tables' meta data.
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ MultipleDataSourcesRuntimeContext.java:59 ] [ createMetaData ] [ - ] [ - ] [ - ] - Meta data load finished, cost 129 milliseconds.
   
   2021-03-23 11:28:44 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ExConfigure.java:131 ] [ setEnvironment ] [ - ] [ - ] [ - ] - ExConfigure initialized > applicationName: dynamic-datasource-sharding-spring, applicationCode: 474
   2021-03-23 11:28:44 [ WARN ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ URLConfigurationSource.java:121 ] [ <init> ] [ - ] [ - ] [ - ] - No URLs will be polled as dynamic configuration sources.
   2021-03-23 11:28:44 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ URLConfigurationSource.java:122 ] [ <init> ] [ - ] [ - ] [ - ] - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
   2021-03-23 11:28:44 [ WARN ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ URLConfigurationSource.java:121 ] [ <init> ] [ - ] [ - ] [ - ] - No URLs will be polled as dynamic configuration sources.
   2021-03-23 11:28:44 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ URLConfigurationSource.java:122 ] [ <init> ] [ - ] [ - ] [ - ] - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
   2021-03-23 11:28:44 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ExecutorConfigurationSupport.java:171 ] [ initialize ] [ - ] [ - ] [ - ] - Initializing ExecutorService 'applicationTaskExecutor'
   2021-03-23 11:28:45 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ EndpointLinksResolver.java:59 ] [ <init> ] [ - ] [ - ] [ - ] - Exposing 2 endpoint(s) beneath base path '/actuator'
   2021-03-23 11:28:45 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Starting ProtocolHandler ["http-nio-8080"]
   2021-03-23 11:28:45 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ TomcatWebServer.java:204 ] [ start ] [ - ] [ - ] [ - ] - Tomcat started on port(s): 8080 (http) with context path ''
   2021-03-23 11:28:45 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ StartupInfoLogger.java:59 ] [ logStarted ] [ - ] [ - ] [ - ] - Started Application in 46.144 seconds (JVM running for 52.186)
   2021-03-23 11:28:45 [ WARN ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ null ] [ null:null ] [  ] [ main ] [ LogbackApplicationRunner.java:52 ] [ run ] [ - ] [ - ] [ - ] - Could not match [%version] because [app.version] config not found! use default: [-1]
   2021-03-23 11:28:45 [ WARN ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ null:null ] [  ] [ main ] [ LogbackApplicationRunner.java:61 ] [ run ] [ - ] [ - ] [ - ] - Could not match [%group] because [app.group] config not found! use default [default]
   2021-03-23 11:28:50 [ WARN ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ 172.20.161.24:null ] [  ] [ main ] [ LogbackApplicationRunner.java:71 ] [ run ] [ - ] [ - ] [ - ] - Could not match [%host] because [server.address] config not found! use localhost [172.20.161.24]
   Open http://127.0.0.1:8080/doc.html 
   2021-03-23 11:28:50 [ INFO ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ 172.20.161.24:8080 ] [  ] [ RMI TCP Connection(4)-172.20.161.24 ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Initializing Spring DispatcherServlet 'dispatcherServlet'
   2021-03-23 11:28:50 [ INFO ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ 172.20.161.24:8080 ] [  ] [ RMI TCP Connection(4)-172.20.161.24 ] [ FrameworkServlet.java:524 ] [ initServletBean ] [ - ] [ - ] [ - ] - Initializing Servlet 'dispatcherServlet'
   2021-03-23 11:28:50 [ INFO ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ 172.20.161.24:8080 ] [  ] [ RMI TCP Connection(4)-172.20.161.24 ] [ FrameworkServlet.java:546 ] [ initServletBean ] [ - ] [ - ] [ - ] - Completed initialization in 38 ms
   2021-03-23 11:28:57 [ ERROR ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ 172.20.161.24:8080 ] [ dc:2330cab548fc48f7bb0f280a0b79438c; ] [ http-nio-8080-exec-2 ] [ GlobalExceptionHandler.java:121 ] [ loggerError ] [ http://localhost:8080/sample/query ] [ 177 ] [ BadSqlGrammarException ] - GlobalExceptionHandler exception happened
   org.springframework.jdbc.BadSqlGrammarException: 
   ### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: Table 'demo1.demo_one' doesn't exist
   ### The error may exist in com/idanchuang/project/basic/ShardingSphereDemoMapper.xml
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: select name, age from demo_one
   ### Cause: java.sql.SQLSyntaxErrorException: Table 'demo1.demo_one' doesn't exist
   ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Table 'demo1.demo_one' doesn't exist
   	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:234)
   	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
   	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:88)
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
   	at com.sun.proxy.$Proxy109.selectList(Unknown Source)
   	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)
   	at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:177)
   	at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:78)
   	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:96)
   	at com.sun.proxy.$Proxy110.query(Unknown Source)
   	at com.idanchuang.project.basic.controller.SampleController.query(SampleController.java:33)
   	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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189)
   	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
   	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
   	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
   	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
   	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
   	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
   	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
   	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
   	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
   	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at com.idanchuang.component.logback.web.filter.RequestStartTimeFilter.doFilter(RequestStartTimeFilter.java:31)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at com.idanchuang.component.just.web.filter.StandardWebFilter.doFilter(StandardWebFilter.java:41)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at com.idanchuang.component.just.web.filter.XssFilter.doFilter(XssFilter.java:30)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at com.idanchuang.component.just.web.filter.ProcessTimeFilter.doFilter(ProcessTimeFilter.java:40)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117)
   	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
   	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
   	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
   	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
   	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
   	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
   	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
   	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
   	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
   	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
   	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
   	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
   	at java.lang.Thread.run(Thread.java:748)
   Caused by: java.sql.SQLSyntaxErrorException: Table 'demo1.demo_one' doesn't exist
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
   	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
   	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:970)
   	at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:387)
   	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
   	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
   	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.ibatis.plugin.Plugin.invoke(Plugin.java:63)
   	at com.sun.proxy.$Proxy138.query(Unknown Source)
   	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.ibatis.plugin.Invocation.proceed(Invocation.java:49)
   	at com.idanchuang.component.mybatis.plus.plugins.ProcessTimeInterceptor.intercept(ProcessTimeInterceptor.java:41)
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
   	at com.sun.proxy.$Proxy138.query(Unknown Source)
   	at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67)
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
   	at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.query(MybatisCachingExecutor.java:155)
   	at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.query(MybatisCachingExecutor.java:90)
   	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.ibatis.plugin.Invocation.proceed(Invocation.java:49)
   	at com.idanchuang.component.mybatis.plus.plugins.PageLimitInterceptor.intercept(PageLimitInterceptor.java:48)
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
   	at com.sun.proxy.$Proxy137.query(Unknown Source)
   	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.ibatis.plugin.Invocation.proceed(Invocation.java:49)
   	at com.idanchuang.support.mybatis.crypt.CryptInterceptor.intercept(CryptInterceptor.java:67)
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
   	at com.sun.proxy.$Proxy137.query(Unknown Source)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
   	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.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
   	... 86 common frames omitted
   


-- 
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] 15898317421 commented on issue #9741: Caused by: java.util.NoSuchElementException: No value bound

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


   Thanks a lot for your answers and help. I solve the combine use with spring dynamic data source and sharding data source. It is my mistake of the way to take data source from spring bean factory. And I will consider your recommend of upgrade the sharding version to 5.0.0, for the long-term supports of community. Thanks again!  


-- 
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] strongduanmu commented on issue #9741: Caused by: java.util.NoSuchElementException: No value bound

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


   @15898317421 There are many differences between the 4.x version and the 5.x version. From a long-term perspective, it is recommended that you upgrade to the 5.x version so that you can get more community support.
   In addition, can you provide detailed information about the exception encountered? 


-- 
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] 15898317421 edited a comment on issue #9741: Caused by: java.util.NoSuchElementException: No value bound

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


   > Hi @15898317421 ,it is
   > `spring.shardingsphere.props.sql-show=true`
   > not
   > `spring.shardingsphere.props.show-sql=true`
   
   not this reason, I tried. It still throw e as the title.


-- 
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] 15898317421 edited a comment on issue #9741: Caused by: java.util.NoSuchElementException: No value bound

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


   In addtion, if I want to combine use the sharding and spring class AbstractRoutingDataSource, the sharing table is not work.
   Can you help me? If I only use sharding, sharding table works fine.
   ![image](https://user-images.githubusercontent.com/31759417/112090030-bcfa2a00-8bcd-11eb-9a3e-06a59b79078c.png)
   
   
   import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
   
   public class PtsDynamicRoutingDataSource extends AbstractRoutingDataSource {
       @Override
       protected Object determineCurrentLookupKey() {
           return "ds0";
       }
   }
   
   import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
   import org.apache.ibatis.plugin.Interceptor;
   import org.apache.ibatis.session.SqlSessionFactory;
   import org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.ShardingDataSource;
   import org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration;
   import org.springframework.beans.BeansException;
   import org.springframework.beans.factory.annotation.Qualifier;
   import org.springframework.boot.autoconfigure.AutoConfigureAfter;
   import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
   import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
   import org.springframework.context.ApplicationContext;
   import org.springframework.context.ApplicationContextAware;
   import org.springframework.context.annotation.Bean;
   import org.springframework.context.annotation.Configuration;
   import org.springframework.context.annotation.Primary;
   import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
   import org.springframework.jdbc.datasource.DataSourceTransactionManager;
   import org.springframework.transaction.PlatformTransactionManager;
   
   import javax.sql.DataSource;
   import java.util.HashMap;
   import java.util.Map;
   
   @ConditionalOnProperty(prefix = "pts.datasource", name = "enabled", havingValue = "true", matchIfMissing = true)
   @Configuration
   @AutoConfigureAfter({DataSourceAutoConfiguration.class, SpringBootConfiguration.class})
    public class PtsDataSourceAutoConfiguration implements ApplicationContextAware {
   
       private ApplicationContext applicationContext;
   
       @Override
       public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
           this.applicationContext = applicationContext;
       }
   
       @Bean
       @Primary
       public DataSource dynamicDataSource(){
           PtsDynamicRoutingDataSource dynamicDataSource = new PtsDynamicRoutingDataSource();
           ShardingDataSource ds0 = applicationContext.getBean(org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.ShardingDataSource.class);
           Map<Object, Object> dataSourceMap = new HashMap<>();
           ds0.getDataSourceMap().entrySet().stream().forEach(e -> dataSourceMap.put(e.getKey(), e.getValue()));
           dynamicDataSource.setTargetDataSources(dataSourceMap);
           return dynamicDataSource;
       }
   
       @Bean
       public SqlSessionFactory sqlSessionFactory(@Qualifier("dynamicDataSource") DataSource dynamicDataSource, Interceptor... plugins) throws Exception {
           MybatisSqlSessionFactoryBean sqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();
           sqlSessionFactoryBean.setDataSource(dynamicDataSource);
           sqlSessionFactoryBean.setPlugins(plugins);
   //        sqlSessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResource("classpath:mapper/*.xml"));
           return sqlSessionFactoryBean.getObject();
       }
   
       @Bean
       public PlatformTransactionManager transactionManager(DataSource dynamicDataSource) {
           return new DataSourceTransactionManager(dynamicDataSource);
       }
   }
   
   2021-03-23 11:28:20 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ SpringApplication.java:675 ] [ logStartupProfileInfo ] [ - ] [ - ] [ - ] - No active profile set, falling back to default profiles: default
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ GenericScope.java:295 ] [ setSerializationId ] [ - ] [ - ] [ - ] - BeanFactory id=ace04a46-de6e-326d-a0d6-557fedcdd543
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'stringToNoneShardingStrategyConfigurationConverter' of type [org.apache.shardingsphere.spring.boot.converter.StringToNoneShardingStrategyConfigurationConverter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'spring.shardingsphere.sharding-org.apache.shardingsphere.shardingjdbc.spring.boot.sharding.SpringBootShardingRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.sharding.SpringBootShardingRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'spring.shardingsphere.masterslave-org.apache.shardingsphere.shardingjdbc.spring.boot.masterslave.SpringBootMasterSlaveRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.masterslave.SpringBootMasterSlaveRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'spring.shardingsphere.encrypt-org.apache.shardingsphere.shardingjdbc.spring.boot.encrypt.SpringBootEncryptRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.encrypt.SpringBootEncryptRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'spring.shardingsphere.shadow-org.apache.shardingsphere.shardingjdbc.spring.boot.shadow.SpringBootShadowRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.shadow.SpringBootShadowRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'spring.shardingsphere-org.apache.shardingsphere.shardingjdbc.spring.boot.common.SpringBootPropertiesConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.common.SpringBootPropertiesConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$9744e1ae] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:21 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$353fa55] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ PostProcessorRegistrationDelegate.java:330 ] [ postProcessAfterInitialization ] [ - ] [ - ] [ - ] - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$1f6dfd52] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ TomcatWebServer.java:90 ] [ initialize ] [ - ] [ - ] [ - ] - Tomcat initialized with port(s): 8080 (http)
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Initializing ProtocolHandler ["http-nio-8080"]
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Starting service [Tomcat]
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Starting Servlet engine: [Apache Tomcat/9.0.36]
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/Users/raistlin/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Initializing Spring embedded WebApplicationContext
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ServletWebServerApplicationContext.java:296 ] [ prepareWebApplicationContext ] [ - ] [ - ] [ - ] - Root WebApplicationContext: initialization completed in 2083 ms
   2021-03-23 11:28:22 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ HikariDataSource.java:110 ] [ getConnection ] [ - ] [ - ] [ - ] - HikariPool-1 - Starting...
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ HikariDataSource.java:123 ] [ getConnection ] [ - ] [ - ] [ - ] - HikariPool-1 - Start completed.
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ConfigurationLogger.java:104 ] [ log ] [ - ] [ - ] [ - ] - ShardingRuleConfiguration:
   tables:
     demo_one:
       actualDataNodes: ds${0}.demo_one_${0..1}
       keyGenerator:
         column: sharding_id
         type: SNOWFLAKE
       logicTable: demo_one
       tableStrategy:
         inline:
           algorithmExpression: demo_one_${sharding_id % 2}
           shardingColumn: sharding_id
   
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ConfigurationLogger.java:104 ] [ log ] [ - ] [ - ] [ - ] - Properties:
   sql-show: 'true'
   
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ShardingMetaDataLoader.java:131 ] [ loadShardingSchemaMetaData ] [ - ] [ - ] [ - ] - Loading 1 logic tables' meta data.
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ SchemaMetaDataLoader.java:70 ] [ load ] [ - ] [ - ] [ - ] - Loading 2 tables' meta data.
   2021-03-23 11:28:23 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ MultipleDataSourcesRuntimeContext.java:59 ] [ createMetaData ] [ - ] [ - ] [ - ] - Meta data load finished, cost 129 milliseconds.
   
   2021-03-23 11:28:44 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ExConfigure.java:131 ] [ setEnvironment ] [ - ] [ - ] [ - ] - ExConfigure initialized > applicationName: dynamic-datasource-sharding-spring, applicationCode: 474
   2021-03-23 11:28:44 [ WARN ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ URLConfigurationSource.java:121 ] [ <init> ] [ - ] [ - ] [ - ] - No URLs will be polled as dynamic configuration sources.
   2021-03-23 11:28:44 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ URLConfigurationSource.java:122 ] [ <init> ] [ - ] [ - ] [ - ] - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
   2021-03-23 11:28:44 [ WARN ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ URLConfigurationSource.java:121 ] [ <init> ] [ - ] [ - ] [ - ] - No URLs will be polled as dynamic configuration sources.
   2021-03-23 11:28:44 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ URLConfigurationSource.java:122 ] [ <init> ] [ - ] [ - ] [ - ] - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
   2021-03-23 11:28:44 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ ExecutorConfigurationSupport.java:171 ] [ initialize ] [ - ] [ - ] [ - ] - Initializing ExecutorService 'applicationTaskExecutor'
   2021-03-23 11:28:45 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ EndpointLinksResolver.java:59 ] [ <init> ] [ - ] [ - ] [ - ] - Exposing 2 endpoint(s) beneath base path '/actuator'
   2021-03-23 11:28:45 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Starting ProtocolHandler ["http-nio-8080"]
   2021-03-23 11:28:45 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ TomcatWebServer.java:204 ] [ start ] [ - ] [ - ] [ - ] - Tomcat started on port(s): 8080 (http) with context path ''
   2021-03-23 11:28:45 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ StartupInfoLogger.java:59 ] [ logStarted ] [ - ] [ - ] [ - ] - Started Application in 46.144 seconds (JVM running for 52.186)
   2021-03-23 11:28:45 [ WARN ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ null ] [ null:null ] [  ] [ main ] [ LogbackApplicationRunner.java:52 ] [ run ] [ - ] [ - ] [ - ] - Could not match [%version] because [app.version] config not found! use default: [-1]
   2021-03-23 11:28:45 [ WARN ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ null:null ] [  ] [ main ] [ LogbackApplicationRunner.java:61 ] [ run ] [ - ] [ - ] [ - ] - Could not match [%group] because [app.group] config not found! use default [default]
   2021-03-23 11:28:50 [ WARN ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ 172.20.161.24:null ] [  ] [ main ] [ LogbackApplicationRunner.java:71 ] [ run ] [ - ] [ - ] [ - ] - Could not match [%host] because [server.address] config not found! use localhost [172.20.161.24]
   Open http://127.0.0.1:8080/doc.html 
   2021-03-23 11:28:50 [ INFO ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ 172.20.161.24:8080 ] [  ] [ RMI TCP Connection(4)-172.20.161.24 ] [ DirectJDKLog.java:173 ] [ log ] [ - ] [ - ] [ - ] - Initializing Spring DispatcherServlet 'dispatcherServlet'
   2021-03-23 11:28:50 [ INFO ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ 172.20.161.24:8080 ] [  ] [ RMI TCP Connection(4)-172.20.161.24 ] [ FrameworkServlet.java:524 ] [ initServletBean ] [ - ] [ - ] [ - ] - Initializing Servlet 'dispatcherServlet'
   2021-03-23 11:28:50 [ INFO ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ 172.20.161.24:8080 ] [  ] [ RMI TCP Connection(4)-172.20.161.24 ] [ FrameworkServlet.java:546 ] [ initServletBean ] [ - ] [ - ] [ - ] - Completed initialization in 38 ms
   2021-03-23 11:28:57 [ ERROR ] [ dynamic-datasource-sharding-spring ] [ -1 ] [ default ] [ 172.20.161.24:8080 ] [ dc:2330cab548fc48f7bb0f280a0b79438c; ] [ http-nio-8080-exec-2 ] [ GlobalExceptionHandler.java:121 ] [ loggerError ] [ http://localhost:8080/sample/query ] [ 177 ] [ BadSqlGrammarException ] - GlobalExceptionHandler exception happened
   org.springframework.jdbc.BadSqlGrammarException: 
   ### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: Table 'demo1.demo_one' doesn't exist
   ### The error may exist in com/idanchuang/project/basic/ShardingSphereDemoMapper.xml
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: select name, age from demo_one
   ### Cause: java.sql.SQLSyntaxErrorException: Table 'demo1.demo_one' doesn't exist
   ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Table 'demo1.demo_one' doesn't exist
   	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:234)
   	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
   	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:88)
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
   	at com.sun.proxy.$Proxy109.selectList(Unknown Source)
   	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)
   	at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:177)
   	at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:78)
   	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:96)
   	at com.sun.proxy.$Proxy110.query(Unknown Source)
   	at com.idanchuang.project.basic.controller.SampleController.query(SampleController.java:33)
   	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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189)
   	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
   	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
   	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
   	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
   	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
   	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
   	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
   	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
   	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
   	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at com.idanchuang.component.logback.web.filter.RequestStartTimeFilter.doFilter(RequestStartTimeFilter.java:31)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at com.idanchuang.component.just.web.filter.StandardWebFilter.doFilter(StandardWebFilter.java:41)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at com.idanchuang.component.just.web.filter.XssFilter.doFilter(XssFilter.java:30)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at com.idanchuang.component.just.web.filter.ProcessTimeFilter.doFilter(ProcessTimeFilter.java:40)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117)
   	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
   	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
   	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
   	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
   	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
   	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
   	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
   	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
   	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
   	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
   	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
   	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
   	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
   	at java.lang.Thread.run(Thread.java:748)
   Caused by: java.sql.SQLSyntaxErrorException: Table 'demo1.demo_one' doesn't exist
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
   	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
   	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:970)
   	at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:387)
   	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
   	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
   	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.ibatis.plugin.Plugin.invoke(Plugin.java:63)
   	at com.sun.proxy.$Proxy138.query(Unknown Source)
   	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.ibatis.plugin.Invocation.proceed(Invocation.java:49)
   	at com.idanchuang.component.mybatis.plus.plugins.ProcessTimeInterceptor.intercept(ProcessTimeInterceptor.java:41)
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
   	at com.sun.proxy.$Proxy138.query(Unknown Source)
   	at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67)
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
   	at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.query(MybatisCachingExecutor.java:155)
   	at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.query(MybatisCachingExecutor.java:90)
   	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.ibatis.plugin.Invocation.proceed(Invocation.java:49)
   	at com.idanchuang.component.mybatis.plus.plugins.PageLimitInterceptor.intercept(PageLimitInterceptor.java:48)
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
   	at com.sun.proxy.$Proxy137.query(Unknown Source)
   	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.ibatis.plugin.Invocation.proceed(Invocation.java:49)
   	at com.idanchuang.support.mybatis.crypt.CryptInterceptor.intercept(CryptInterceptor.java:67)
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
   	at com.sun.proxy.$Proxy137.query(Unknown Source)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
   	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.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
   	... 86 common frames omitted
   


-- 
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] 15898317421 commented on issue #9741: Caused by: java.util.NoSuchElementException: No value bound

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


   > Hi @15898317421 ,it is
   > `spring.shardingsphere.props.sql-show=true`
   > not
   > `spring.shardingsphere.props.show-sql=true`
   
   not this reason


-- 
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] 15898317421 commented on issue #9741: Caused by: java.util.NoSuchElementException: No value bound

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


   Hi, I looking the doc before, but what is work-id that I need config?
   And if I want to compatible down forward to sharding-jdbc 4.0.0 version, I must change my properties in application?
   Have you any ideas to solve this problem?


-- 
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] 15898317421 commented on issue #9741: Caused by: java.util.NoSuchElementException: No value bound

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


   Here is the exception stack and properties configuration, and I want to know what the work-id is in properties.
   The only difference is version 4.0.0 and 5.0.0, other is the same completely such as the code.
   
   stack of exception
   
   2021-03-23 10:23:05 [ INFO ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ SpringApplication.java:675 ] [ logStartupProfileInfo ] [ - ] [ - ] [ - ] - No active profile set, falling back to default profiles: default
   2021-03-23 10:23:06 [ ERROR ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ SpringApplication.java:858 ] [ reportFailure ] [ - ] [ - ] [ - ] - Application run failed
   java.lang.reflect.InvocationTargetException: null
   	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.sharding.spring.boot.algorithm.ShardingAlgorithmProvidedBeanRegistry.postProcessBeanDefinitionRegistry(ShardingAlgorithmProvidedBeanRegistry.java:38)
   	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:705)
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
   	at com.idanchuang.project.basic.Application.main(Application.java:18)
   Caused by: java.util.NoSuchElementException: No value bound
   	at org.springframework.boot.context.properties.bind.BindResult.get(BindResult.java:56)
   	... 21 common frames omitted
   2021-03-23 10:23:06 [ WARN ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ Dsn.java:102 ] [ dsnFrom ] [ - ] [ - ] [ - ] - *** Couldn't find a suitable DSN, Sentry operations will do nothing! See documentation: https://docs.sentry.io/clients/java/ ***
   2021-03-23 10:23:06 [ WARN ] [ null ] [ null ] [ null ] [ null:null ] [  ] [ main ] [ DefaultSentryClientFactory.java:556 ] [ getInAppFrames ] [ - ] [ - ] [ - ] - No 'stacktrace.app.packages' was configured, this option is highly recommended as it affects stacktrace grouping and display on Sentry. See documentation: https://docs.sentry.io/clients/java/config/#in-application-stack-frames
   Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
   	at org.springframework.util.ReflectionUtils.rethrowRuntimeException(ReflectionUtils.java:354)
   	at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:841)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
   	at com.idanchuang.project.basic.Application.main(Application.java:18)
   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.sharding.spring.boot.algorithm.ShardingAlgorithmProvidedBeanRegistry.postProcessBeanDefinitionRegistry(ShardingAlgorithmProvidedBeanRegistry.java:38)
   	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:705)
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
   	... 3 more
   Caused by: java.util.NoSuchElementException: No value bound
   	at org.springframework.boot.context.properties.bind.BindResult.get(BindResult.java:56)
   	... 21 more
   
   properties of application
   
   server.port=8080
   spring.application.name=dynamic-datasource-sharding-spring
   
   spring.shardingsphere.props.show-sql=true
   
   # sharding sphere data source name for spring
   spring.shardingsphere.datasource.names=ds0
   
   # sharding sphere data source configuration for spring
   spring.shardingsphere.datasource.ds0.type=com.zaxxer.hikari.HikariDataSource
   spring.shardingsphere.datasource.ds0.driver-class-name=com.mysql.cj.jdbc.Driver
   spring.shardingsphere.datasource.ds0.jdbc-url=jdbc:mysql://localhost:3316/demo1
   spring.shardingsphere.datasource.ds0.username=root
   spring.shardingsphere.datasource.ds0.password=123456
   
   # table sharding with 4.0.0 version
   #spring.shardingsphere.sharding.tables.demo_one.actual-data-nodes = ds${0}.demo_one_${0..1}
   #spring.shardingsphere.sharding.tables.demo_one.table-strategy.inline.sharding-column = sharding_id
   #spring.shardingsphere.sharding.tables.demo_one.table-strategy.inline.algorithm-expression = demo_one_${sharding_id % 2}
   #spring.shardingsphere.sharding.tables.demo_one.key-generator.column = sharding_id
   #spring.shardingsphere.sharding.tables.demo_one.key-generator.type = SNOWFLAKE
   
   #sharding rules configuration with 5.0.0 version
   spring.shardingsphere.sharding.tables.demo_one.actual-data-nodes = ds$->{0}.demo_one_$->{0..1}
   spring.shardingsphere.sharding.tables.demo_one.table-strategy.standard.sharding-column=sharding_id
   spring.shardingsphere.sharding.tables.demo_one.table-strategy.standard.sharding-algorithm-name=demo-one-table-strategy-inline
   
   #sharding algorithms configuration 5.0.0 version
   spring.shardingsphere.rules.sharding.sharding-algorithms.demo-one-table-strategy-inline.type=INLINE
   spring.shardingsphere.rules.sharding.sharding-algorithms.demo-one-table-strategy-inline.algorithm-expression=demo_one_$->{sharding_id % 2}
   
   #key generate strategy configuration 5.0.0 version
   spring.shardingsphere.rules.sharding.tables.demo_one.key-generate-strategy.column=sharding_id
   spring.shardingsphere.rules.sharding.tables.demo_one.key-generate-strategy.key-generator-name=snowflake
   
   #key generators configuration 5.0.0 version
   spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
   spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=
   
   
   


-- 
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] 15898317421 closed issue #9741: Caused by: java.util.NoSuchElementException: No value bound

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


   


-- 
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] huanghao495430759 commented on issue #9741: Caused by: java.util.NoSuchElementException: No value bound

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


   Hi,you can looking doc.5.* :
   [https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-jdbc/configuration/spring-boot-starter/](url)
   
   `
   #sharding rules configuration
   spring.shardingsphere.sharding.tables.demo_one.actual-data-nodes = ds$->{0}.demo_one_$->{0..1}
   spring.shardingsphere.sharding.tables.demo_one.table-strategy.standard.sharding-column=sharding_id
   spring.shardingsphere.sharding.tables.demo_one.table-strategy.standard.sharding-algorithm-name=demo-one-table-strategy-inline
   
   #sharding algorithms configuration
   spring.shardingsphere.rules.sharding.sharding-algorithms.demo-one-table-strategy-inline.type=INLINE
   spring.shardingsphere.rules.sharding.sharding-algorithms.demo-one-table-strategy-inline.algorithm-expression=demo_one_$->{sharding_id % 2}
   
   #key generate strategy configuration
   spring.shardingsphere.rules.sharding.tables.demo_one.key-generate-strategy.column=sharding_id
   spring.shardingsphere.rules.sharding.tables.demo_one.key-generate-strategy.key-generator-name=snowflake
   
   #key generators configuration
   spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
   spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=
   `


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