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/09/04 15:45:12 UTC

[GitHub] [shardingsphere] yangsheng1995 opened a new issue #7259: Missing the data source name: 'null'

yangsheng1995 opened a new issue #7259:
URL: https://github.com/apache/shardingsphere/issues/7259


         I have a bug, It's "Missing the data source name: 'null'" on use shardingsphere. I perform an "insert" to insert a set of data into the database, he returned the exception to me.
        Here's mine properties of shardingSphere:
   spring.main.allow-bean-definition-overriding=true
   spring.shardingsphere.datasource.names=ds0,ds1
   #ds0
   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:3306/ds0?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
   spring.shardingsphere.datasource.ds0.username=root
   spring.shardingsphere.datasource.ds0.password=123456
   #ds1
   spring.shardingsphere.datasource.ds1.type=com.zaxxer.hikari.HikariDataSource
   spring.shardingsphere.datasource.ds1.driver-class-name=com.mysql.cj.jdbc.Driver
   spring.shardingsphere.datasource.ds1.jdbc-url=jdbc:mysql://localhost:3306/ds1?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
   spring.shardingsphere.datasource.ds1.username=root
   spring.shardingsphere.datasource.ds1.password=123456
   
   spring.shardingsphere.sharding.tables.t_user.actual-data-nodes=ds$->{0..1}.t_user$->{0..1}
   spring.shardingsphere.sharding.tables.t_user.database-strategy.inline.sharding-column=age
   spring.shardingsphere.sharding.tables.t_user.database-strategy.inline.algorithm-expression=t_user$->{age % 2}
   
   spring.shardingsphere.sharding.tables.t_user.table-strategy.inline.sharding-column=score
   spring.shardingsphere.sharding.tables.t_user.table-strategy.inline.algorithm-expression=t_user$->{score % 2}
   
   spring.shardingsphere.props.sql.low=true
   spring.shardingsphere.sharding.tables.t_user.key-generator.column=id
   spring.shardingsphere.sharding.tables.t_user.key-generator.type=UUID
   
          Here's mine SQL statement of mysql:
   CREATE TABLE IF NOT EXISTS `T_USER0` (
   	`ID` BIGINT NOT NULL,
   	`USER_NAME` VARCHAR(20) NOT NULL,
   	`AGE` int NOT NULL DEFAULT 0,
   	`SCORE` int NOT NULL DEFAULT 0,
   	PRIMARY KEY (`ID`)
   ) ENGINE=INNODB DEFAULT CHARSET=UTF8;
   CREATE TABLE IF NOT EXISTS `T_USER1` (
   	`ID` BIGINT NOT NULL,
   	`USER_NAME` VARCHAR(20) NOT NULL,
   	`AGE` int NOT NULL DEFAULT 0,
   	`SCORE` int NOT NULL DEFAULT 0,
   	PRIMARY KEY (`ID`)
   ) ENGINE=INNODB DEFAULT CHARSET=UTF8;
   
         Here's mine SQL statement of mysql:
   private void getData() {
           userList.add(new UserEntity(1L, "bigBig", 4, 8));
           userList.add(new UserEntity(7L, "smallSmall", 3, 3));
           userList.add(new UserEntity(9L, "dad", 31, 1));
           userList.add(new UserEntity(2L, "mom", 28, 0));
           userList.add(new UserEntity(6L, "grandpa", 63, 2));
           userList.add(new UserEntity(3L, "grandma", 62, 7));
   }
      Can you tell me the bug.


----------------------------------------------------------------
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] tristaZero commented on issue #7259: Missing the data source name: 'null'

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


   Hi, @yangsheng1995 
   I found you reopened this issue. So how is this issue going? Still exists?


----------------------------------------------------------------
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] yangsheng1995 closed issue #7259: Missing the data source name: 'null'

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


   


----------------------------------------------------------------
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] yangsheng1995 commented on issue #7259: Missing the data source name: 'null'

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


   I haven't question. I already solve the question, thank you!


----------------------------------------------------------------
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] tristaZero edited a comment on issue #7259: Missing the data source name: 'null'

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


   Hi, @yangsheng1995 
   I found you reopened this issue. So how is this issue going? Still, exists?


----------------------------------------------------------------
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] yangsheng1995 closed issue #7259: Missing the data source name: 'null'

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


   


----------------------------------------------------------------
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] yangsheng1995 commented on issue #7259: Missing the data source name: 'null'

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


        Here's mine pom.xml of maven:
   <dependencies>
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-data-jdbc</artifactId>
           </dependency>
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-web</artifactId>
           </dependency>
           <dependency>
               <groupId>org.mybatis.spring.boot</groupId>
               <artifactId>mybatis-spring-boot-starter</artifactId>
               <version>2.1.3</version>
           </dependency>
   
           <dependency>
               <groupId>mysql</groupId>
               <artifactId>mysql-connector-java</artifactId>
               <scope>runtime</scope>
           </dependency>
           <dependency>
               <groupId>org.projectlombok</groupId>
               <artifactId>lombok</artifactId>
               <optional>true</optional>
           </dependency>
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-test</artifactId>
               <scope>test</scope>
               <exclusions>
                   <exclusion>
                       <groupId>org.junit.vintage</groupId>
                       <artifactId>junit-vintage-engine</artifactId>
                   </exclusion>
               </exclusions>
           </dependency>
   
           <dependency>
               <groupId>com.baomidou</groupId>
               <artifactId>mybatis-plus-boot-starter</artifactId>
               <version>3.0.7.1</version>
               <exclusions>
                   <exclusion>
                       <groupId>com.baomidou</groupId>
                       <artifactId>mybatis-plus-generator</artifactId>
                   </exclusion>
               </exclusions>
           </dependency>
   
           <dependency>
               <groupId>com.google.code.gson</groupId>
               <artifactId>gson</artifactId>
               <version>2.8.6</version>
           </dependency>
   
   <!--        <dependency>-->
   <!--            <groupId>com.zaxxer</groupId>-->
   <!--            <artifactId>HikariCP</artifactId>-->
   <!--        </dependency>-->
   
   
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
               <version>4.0.0-RC1</version>
           </dependency>
   
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>sharding-jdbc-spring-namespace</artifactId>
               <version>4.0.0-RC1</version>
           </dependency>
       </dependencies>


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