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/10/01 09:46:59 UTC
[GitHub] [shardingsphere] WswSummer15 opened a new issue #12869: Error creating bean with name 'dataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]
WswSummer15 opened a new issue #12869:
URL: https://github.com/apache/shardingsphere/issues/12869
(MacOS IDEA)Program startup error:
Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 0; nested exception is org.
springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthContributorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthContributorRegistry]: Factory method 'healthContributorRegistry' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthContributorAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBo
otConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalArgumentException: Data sources cannot be empty.
springboot + shardingsphere + HikariDataSource
<java.version>1.8</java.version>
<mysql.version>8.0.18</mysql.version>
<spring.boot.version>2.2.2.RELEASE</spring.boot.version>
<sharding-jdbc.version>4.0.0-RC1</sharding-jdbc.version>
config.yaml here:
spring:
shardingsphere:
datasource:
names: ds0
ds0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
jdbcUrl:
username:
password:
hikari:
minimum-idle: 5
max-lifetime: 1800000
maximum-pool-size: 15
auto-commit: true
idle-timeout: 30000
pool-name: DatebookHikariCP
connection-timeout: 30000
sharding:
tables:
task:
actual-data-nodes: ds0.task_$->{2020..2021}
table-strategy:
standard:
sharding-column: create_date
precise-algorithm-class-name:
range-algorithm-class-name:
key-generator:
column: task_id
type: SNOWFLAKE
defaultDataSourceName: ds0
props:
sql:
show: 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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] agoodcoolman commented on issue #12869: Error creating bean with name 'dataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]
Posted by GitBox <gi...@apache.org>.
agoodcoolman commented on issue #12869:
URL: https://github.com/apache/shardingsphere/issues/12869#issuecomment-973738012
the same question,
use sharding-jdbc-5.0.0
this is my ymal config
`schemaName: sharding_db
mode:
type: memory
dataSources:
ds0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name:
jdbc-url:
username:
password:
ds1:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc-url:
username:
password:
rules:
tables:
data_door_info_all:
actual-data-nodes: ds${[0,1]}.data_door_info_all_$->{[0,1,2,3]}
databaseStrategy:
standard:
sharding-column: id
shardingAlgorithmName: hash_mode
table-strategy:
standard:
sharding-column: idcard
sharding-algorithm-name: hash_mode
defaultTableStrategy:
none:
sharding-algorithms:
hash_mod:
type: MOD
props:
sharding-count: 3
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker-id: 123`
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] WswSummer15 commented on issue #12869: Error creating bean with name 'dataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]
Posted by GitBox <gi...@apache.org>.
WswSummer15 commented on issue #12869:
URL: https://github.com/apache/shardingsphere/issues/12869#issuecomment-932086544
> Please read the matched document first
Without reading the official document, I will ask here?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu commented on issue #12869: Error creating bean with name 'dataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #12869:
URL: https://github.com/apache/shardingsphere/issues/12869#issuecomment-932083570
Please read the matched document first
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] WswSummer15 commented on issue #12869: Error creating bean with name 'dataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]
Posted by GitBox <gi...@apache.org>.
WswSummer15 commented on issue #12869:
URL: https://github.com/apache/shardingsphere/issues/12869#issuecomment-932084967
> you use sharding-jdbc 4.0.0 RC1 ?
yes
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] WswSummer15 commented on issue #12869: Error creating bean with name 'dataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]
Posted by GitBox <gi...@apache.org>.
WswSummer15 commented on issue #12869:
URL: https://github.com/apache/shardingsphere/issues/12869#issuecomment-932085856
> you use sharding-jdbc 4.0.0 RC1 ?
Same configuration file, Windows good, MAC error
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] taojintianxia commented on issue #12869: Error creating bean with name 'dataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on issue #12869:
URL: https://github.com/apache/shardingsphere/issues/12869#issuecomment-932083699
you use sharding-jdbc 4.0.0 RC1 ?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org