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/06/05 03:28:26 UTC

[GitHub] [shardingsphere] jaedongjuly opened a new issue #5929: Use 4.0.1 in spring boot 2.2.1 。get error Failed to configure a DataSource。

jaedongjuly opened a new issue #5929:
URL: https://github.com/apache/shardingsphere/issues/5929


   I use 4.0.1   in my spring boot 2.2.1
   --------------------<br>
    <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
               <version>4.0.1</version>
     </dependency>
   ----------------------------<br>
   But i get error
   --------------------------------------------<br>
   Description:
   Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
   Reason: Failed to determine a suitable driver class
   Action:
   Consider the following:
   	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
   	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
   ------------------------------------------------------------<br>
   I change  4.0.0-RC1 version 
   ------------------------------------------------------------<br>
    <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
               <version>4.0.0-RC1</version>
     </dependency>
   ------------------------------------------------------------<br>
   The error is  gone;
   
   What's the 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] jaedongjuly commented on issue #5929: Use 4.0.1 in spring boot 2.2.2 。get error Failed to configure a DataSource。

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


   > where durid config?
   
   I don't write druid config.
   
   I use    
   ~~~
   <dependency>
               <groupId>com.alibaba</groupId>
               <artifactId>druid</artifactId>
               <version>1.1.20</version>
           </dependency>
   ~~~
    instead of
   ~~~
     <dependency>
                     <groupId>com.alibaba</groupId>
                     <artifactId>druid-spring-boot-starter</artifactId>
                     <version>1.1.20</version>
                 </dependency>
   ~~~
   My demo run well.
   
    
   
   


----------------------------------------------------------------
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] menghaoranss commented on issue #5929: Use 4.0.1 in spring boot 2.2.2 。get error Failed to configure a DataSource。

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


   @jaedongjuly Could you try it again with the latest version?


----------------------------------------------------------------
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 #5929: Use 4.0.1 in spring boot 2.2.2 。get error Failed to configure a DataSource。

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


   @jaedongjuly  show you configuration,druid datasource property is url ? you config jdbc-url?


----------------------------------------------------------------
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 #5929: Use 4.0.1 in spring boot 2.2.2 。get error Failed to configure a DataSource。

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


   @jaedongjuly  Please do not use `druid-spring-boot-starter `  Because it conflicts with the `Sharding-datasource`


----------------------------------------------------------------
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] kimmking closed issue #5929: Use 4.0.1 in spring boot 2.2.2 。get error Failed to configure a DataSource。

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


   


----------------------------------------------------------------
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 #5929: Use 4.0.1 in spring boot 2.2.2 。get error Failed to configure a DataSource。

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


   where  durid config?
   


----------------------------------------------------------------
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] kimmking commented on issue #5929: Use 4.0.1 in spring boot 2.2.2 。get error Failed to configure a DataSource。

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


   duplicated https://github.com/apache/shardingsphere/issues/5697


----------------------------------------------------------------
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] jaedongjuly commented on issue #5929: Use 4.0.1 in spring boot 2.2.2 。get error Failed to configure a DataSource。

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


   > @jaedongjuly show you configuration,druid datasource property is url ? you config jdbc-url?
   
   ~~~
   spring.shardingsphere.datasource.names=m1
   spring.shardingsphere.datasource.m1.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.m1.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.m1.url=jdbc:mysql://localhost:3306/course_db?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
   spring.shardingsphere.datasource.m1.username=root
   spring.shardingsphere.datasource.m1.password=
   #配置course表
   spring.shardingsphere.sharding.tables.course.actual-data-nodes=m1.course_$->{1..2}
   #自增列名称,course用自增主键生成器
   spring.shardingsphere.sharding.tables.course.key-generator.column=cid
   # course 可使用用户自定义的列值生成器或选择内置类型:SNOWFLAKE/UUID
   spring.shardingsphere.sharding.tables.course.key-generator.type=SNOWFLAKE
   #分片列名称
   spring.shardingsphere.sharding.tables.course.table-strategy.inline.sharding-column=cid
   #分片算法行表达式,需符合groovy语法
   spring.shardingsphere.sharding.tables.course.table-strategy.inline.algorithm-expression=course_$->{cid % 2 + 1}
   #是否开启SQL显示,默认值: false
   spring.shardingsphere.props.sql.show=true
   ~~~
   This is only my application.properties.
     


----------------------------------------------------------------
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] jaedongjuly commented on issue #5929: Use 4.0.1 in spring boot 2.2.2 。get error Failed to configure a DataSource。

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


   > @jaedongjuly Could you try it again with the latest version?
   
   I use 4.1.0 
   
   
   ~~~
     <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
               <version>4.1.0</version>
           </dependency>
   ~~~
   and get same  
   ~~~
   Description:
   
   Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
   
   Reason: Failed to determine a suitable driver class
   
   
   Action:
   
   Consider the following:
   	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
   	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
   
   ~~~


----------------------------------------------------------------
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] jaedongjuly commented on issue #5929: Use 4.0.1 in spring boot 2.2.2 。get error Failed to configure a DataSource。

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


   > @jaedongjuly Please do not use `druid-spring-boot-starter ` Because it conflicts with the `Sharding-datasource`
   
   I guess some wrong with druid-spring-boot-starter  too .
   but i don't find reason .
   I want to know .


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