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/02/04 02:59:47 UTC

[GitHub] [shardingsphere] zhuyongsheng-428 opened a new issue #9309: druid-spring-boot-starter 1.2.4 cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource

zhuyongsheng-428 opened a new issue #9309:
URL: https://github.com/apache/shardingsphere/issues/9309


   ### druid version
   ```group: 'com.alibaba', name: 'druid-spring-boot-starter', version: '1.2.4'```
   ### shardingsphere version
   ```group: 'org.apache.shardingsphere', name: 'shardingsphere-jdbc-core-spring-boot-starter', version: '5.0.0-alpha'```
   ### application.yml
   ``` yaml   shardingsphere:
           datasource:
               common:
                   driver-class-name: com.mysql.cj.jdbc.Driver
                   username: guest
                   password: 123456
               names: ds0,ds1
               ds0:
                   url: jdbc:mysql://localhost:3306/pension_pz?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
                   driver-class-name: com.mysql.cj.jdbc.Driver
                   username: guest
                   password: 123456
                   type: com.alibaba.druid.pool.DruidDataSource
               ds1:
                   url: jdbc:mysql://localhost:3306/nacos?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
                   driver-class-name: com.mysql.cj.jdbc.Driver
                   username: guest
                   password: 123456
                   type: com.alibaba.druid.pool.DruidDataSource```
   ### error log
   ``` log org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/C:/Users/njpkh/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-spring-webmvc/3.0.0/7ed22363fdfd651cd811c0b2391f16bddb91db8b/springfox-spring-webmvc-3.0.0.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webEndpointServletHandlerMapping' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/servlet/WebMvcEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMappin
 g]: Factory method 'webEndpointServletHandlerMapping' 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.Unsatisfied
 DependencyException: 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 'shardingSphereDataSource' defined in class path resource [org/apache/shardingsphere/spring/boot/SpringBootConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource
   	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:799) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:228) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
   	at com.fedtech.elderly.provider.ServiceElderlyApplication.main(ServiceElderlyApplication.java:25) [classes/:na]```
   


----------------------------------------------------------------
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] linghengqian commented on issue #9309: druid-spring-boot-starter 1.2.4 cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource

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


   > > hi, you can see this : #1900
   > 
   > May they are not a same question. #1900 is a duplicate beans problem, but this is cause by the final class `ShardingSphereDataSouce` is bean proxied.
   
   @climy007 
   - In fact this is repeated problem, refer to https://github.com/apache/shardingsphere/issues/8940#issuecomment-1050848342
   - You must refer the starter version of Druid to `1.2.8` or druid's `master` branch.


-- 
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] tuohai666 closed issue #9309: druid-spring-boot-starter 1.2.4 cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource

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


   


----------------------------------------------------------------
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] zhuyongsheng-428 removed a comment on issue #9309: druid-spring-boot-starter 1.2.4 cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource

Posted by GitBox <gi...@apache.org>.
zhuyongsheng-428 removed a comment on issue #9309:
URL: https://github.com/apache/shardingsphere/issues/9309#issuecomment-772994139


   This question took me too much time。。
   I tried to change the version to 4.0.0 just now, and it succeeded! ! !


----------------------------------------------------------------
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 #9309: druid-spring-boot-starter 1.2.4 cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource

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


   hi, you can see this : https://github.com/apache/shardingsphere/issues/1900


----------------------------------------------------------------
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] zhuyongsheng-428 commented on issue #9309: druid-spring-boot-starter 1.2.4 cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource

Posted by GitBox <gi...@apache.org>.
zhuyongsheng-428 commented on issue #9309:
URL: https://github.com/apache/shardingsphere/issues/9309#issuecomment-772994139


   This question took me too much time。。
   I tried to change the version to 4.0.0 just now, and it succeeded! ! !


----------------------------------------------------------------
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] zhuyongsheng-428 closed issue #9309: druid-spring-boot-starter 1.2.4 cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource

Posted by GitBox <gi...@apache.org>.
zhuyongsheng-428 closed issue #9309:
URL: https://github.com/apache/shardingsphere/issues/9309


   


----------------------------------------------------------------
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 #9309: druid-spring-boot-starter 1.2.4 cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource

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


   hi, you can see this : https://github.com/apache/shardingsphere/issues/1900


----------------------------------------------------------------
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] tuohai666 closed issue #9309: druid-spring-boot-starter 1.2.4 cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource

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


   


----------------------------------------------------------------
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] climy007 commented on issue #9309: druid-spring-boot-starter 1.2.4 cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource

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


   > hi, you can see this : #1900
   
   May they are not a same question. #1900 is a duplicate beans problem, but this is cause by the final class `ShardingSphereDataSouce` is bean proxied.


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