Enviroment
JDK Version(required):
SpringBoot Version(required):
dynamic-datasource-spring-boot-starter Version(required):3.3.0
druid Version(optional):
Describe what happened
我是用的是你们3.3.0版本的本地事务功能,并没有配置seata事务,为什么项目启动的时候会报这个错误
Expected Result:
2020-12-24 18:01:14:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceCreator' defined in class path resource [com/baomidou/dynamic/datasource/spring/boot/autoconfigure/DynamicDataSourceCreatorAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.baomidou.dynamic.datasource.creator.DefaultDataSourceCreator]: Factory method 'dataSourceCreator' threw exception; nested exception is java.lang.NoClassDefFoundError: io/seata/rm/datasource/SeataDataSourceProxy
2020-12-24 18:01:14: at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:635)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$166/1502635287.getObject(Unknown Source)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
2020-12-24 18:01:14: at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227)
2020-12-24 18:01:14: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640)
2020-12-24 18:01:14: ... 150 common frames omitted
2020-12-24 18:01:14:Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.baomidou.dynamic.datasource.creator.DefaultDataSourceCreator]: Factory method 'dataSourceCreator' threw exception; nested exception is java.lang.NoClassDefFoundError: io/seata/rm/datasource/SeataDataSourceProxy
2020-12-24 18:01:14: at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:650)
2020-12-24 18:01:14: ... 164 common frames omitted
2020-12-24 18:01:14:Caused by: java.lang.NoClassDefFoundError: io/seata/rm/datasource/SeataDataSourceProxy
2020-12-24 18:01:14: at com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceCreatorAutoConfiguration.dataSourceCreator(DynamicDataSourceCreatorAutoConfiguration.java:53)
2020-12-24 18:01:14: at com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceCreatorAutoConfiguration$$EnhancerBySpringCGLIB$$2902767d.CGLIB$dataSourceCreator$2()
2020-12-24 18:01:14: at com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceCreatorAutoConfiguration$$EnhancerBySpringCGLIB$$2902767d$$FastClassBySpringCGLIB$$b42d278.invoke()
2020-12-24 18:01:14: at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
2020-12-24 18:01:14: at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
2020-12-24 18:01:14: at com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceCreatorAutoConfiguration$$EnhancerBySpringCGLIB$$2902767d.dataSourceCreator()
2020-12-24 18:01:14: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2020-12-24 18:01:14: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2020-12-24 18:01:14: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2020-12-24 18:01:14: at java.lang.reflect.Method.invoke(Method.java:497)
2020-12-24 18:01:14: at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
2020-12-24 18:01:14: ... 165 common frames omitted
2020-12-24 18:01:14:Caused by: java.lang.ClassNotFoundException: io.seata.rm.datasource.SeataDataSourceProxy
2020-12-24 18:01:14: at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
2020-12-24 18:01:14: at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
2020-12-24 18:01:14: at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151)
2020-12-24 18:01:14: at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Actual Result:
If there is an exception,or aop invalid,please attach the exception trace:
Just paste your stack trace here!
Steps to reproduce
Step 1
Step 2
Step 3