Springboot-Notebook icon indicating copy to clipboard operation
Springboot-Notebook copied to clipboard

springboot-sharding-jdbc 启动不了 报错

Open blankhang opened this issue 5 years ago • 2 comments

git 直接拉你的代码 启动报错 Error:(13, 43) java: 程序包com.xiaoju.uemc.tinyid.client.utils不存在

blankhang avatar Nov 04 '20 04:11 blankhang

直接按你微信文章的 写的启动也报错 蛋疼

2020-11-04 11:15:26.196  INFO 9012 --- [           main] c.b.shardingsql.ShardingsqlApplication   : No active profile set, falling back to default profiles: default
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass$3$1 (file:/D:/Java/.m2/repository/org/codehaus/groovy/groovy/2.4.5/groovy-2.4.5-indy.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass$3$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2020-11-04 11:15:26.929  WARN 9012 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'dataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]] for bean 'dataSource': There is already [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure; factoryMethodName=dataSource; initMethodName=init; destroyMethodName=(inferred); defined in class path resource [com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceAutoConfigure.class]] bound.
2020-11-04 11:15:26.937  INFO 9012 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-11-04 11:15:26.939 ERROR 9012 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'dataSource', defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceAutoConfigure.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

Disconnected from the target VM, address: '127.0.0.1:59111', transport: 'socket'

Process finished with exit code 1

blankhang avatar Nov 04 '20 04:11 blankhang

方便就加我 wx:chengxy-nds91 我瞅一眼,com.xiaoju.uemc.tinyid.client.utils 可以删掉不用,如果直接启动我的项目不会除了刚才的报错不会有什么问题

chengxy-nds avatar Nov 04 '20 04:11 chengxy-nds