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/08/23 16:17:20 UTC

[GitHub] [shardingsphere] rfscouto opened a new issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

rfscouto opened a new issue #11962:
URL: https://github.com/apache/shardingsphere/issues/11962


   Using version 5.0.0-beta, and liquibase 4.4.3.
   I am getting the following exception:
   
   ```
   Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]: Factory method 'liquibase' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shardingSphereDataSource' defined in class path resource [org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.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.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
   at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651)
   ... 28 common frames omitted
   
   Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shardingSphereDataSource' defined in class path resource [org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.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.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:603)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
   at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
   at
   org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
   at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1290)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory$DependencyObjectProvider.getIfUnique(DefaultListableBeanFactory.java:1947)
   at org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration.liquibase(LiquibaseAutoConfiguration.java:101)
   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
   ... 29 common frames omitted
   
   Caused by: 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.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:208)
   at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110)
   at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:471)
   at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:350)
   at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:299)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:431)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
   ... 43 common frames omitted
   Caused by: java.lang.IllegalArgumentException: Cannot subclass final class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource
   at org.springframework.cglib.proxy.Enhancer.generateClass(Enhancer.java:657)
   at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
   at org.springframework.cglib.core.ClassLoaderAwareGeneratorStrategy.generate(ClassLoaderAwareGeneratorStrategy.java:57)
   at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:358)
   at org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:582)
   at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110)
   at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108)
   at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
   at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
   at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:134)
   at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:319)
   at org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:569)
   at org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:416)
   at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:57)
   at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:205)
   
   ... 50 common frames omitted
   ```
   
   Is liquibase even supposed to work? I have seen a few issues where it seems people made some progress.


-- 
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] tristaZero edited a comment on issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

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


   Sorry, I can not catch you clearly. So you set up X sharding databases, and have liquibase handle each of them. Then your application creates a ShardingSphereDataSource to make these X sharding databases as a single logical dataSource which routes the SQL to a certain sharding database.
   Do I catch your expectation? So your application hasn't started up? ;-)


-- 
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] ruicouto-syncier commented on issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

Posted by GitBox <gi...@apache.org>.
ruicouto-syncier commented on issue #11962:
URL: https://github.com/apache/shardingsphere/issues/11962#issuecomment-904015414


   I ended up creating my own factory that provides a not final version of  ShardingSphereDataSource. Then, and after setting a default schema for liquibase the process goes forward.


-- 
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] rfscouto closed issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

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


   


-- 
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] rfscouto commented on issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

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


   That is my expectation, yes.
   My application has not started up yet; this issue is no longer valid, as I got over it by redefining ShardingSphereDataSource. I am now facing https://github.com/apache/shardingsphere/issues/5432, having pushed a fix for it, but now need to get the local build running so I can use that artifact and keep trying to spin up my server.


-- 
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] ruicouto-syncier removed a comment on issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

Posted by GitBox <gi...@apache.org>.
ruicouto-syncier removed a comment on issue #11962:
URL: https://github.com/apache/shardingsphere/issues/11962#issuecomment-904015414


   I ended up creating my own factory that provides a not final version of  ShardingSphereDataSource. Then, and after setting a default schema for liquibase the process goes forward.


-- 
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] tristaZero commented on issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

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


   Hi thanks for your question, it looks interesting.
   Do you plan to use Liquibase to manage ShardingSphere Proxy which helps shard databases?
   So you just redefined `ShardingSphereDataSource` as a non-final class and it worked fine?


-- 
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] rfscouto commented on issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

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


   Actually, I am using ShardingSphere JDBC. Exactly, I just redefined `ShardingSphereDataSource`; worked fine is another question. I get other issues afterwards (https://github.com/apache/shardingsphere/issues/5432), but liquibase seems to initialize. 
   My idea is to setup X sharding databases, one being the main one. Then configure SpringLiquibase, one per each DataSource that ShardingSphere creates. Then use ShardingSphere to write to the correct datasource, and have liquibase handle each DS individually. But I need my application to start 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] tristaZero commented on issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

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


   Aha, thanks for your PR, and look forward to your good news. ;-) @rfscouto 


-- 
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] tristaZero edited a comment on issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

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


   Hi @rfscholte  thanks for your question, it looks interesting. 
   Do you plan to use Liquibase to manage ShardingSphere Proxy which helps shard databases?
   So you just redefined `ShardingSphereDataSource` as a non-final class and it worked fine?


-- 
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] rfscouto commented on issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

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


   I ended up creating my own factory that provides a not final version of ShardingSphereDataSource. Then, and after setting a default schema for liquibase the process goes forward.
   


-- 
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] tristaZero commented on issue #11962: Liquibase exception: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]

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


   Sorry, I can not catch you clearly. So you set up X sharding databases, and have liquibase handle each of them. Then your application creates a ShardingSphereDataSource to make these X sharding databases as a single logical dataSource which routes the SQL to a certain sharding database.
   Is it your expectation? So your application hasn't started up?


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