在boot版本部署到tomcat上后,启动发现存在bean冲突的问题;
TenantConfiguration和MybatisPlusConfiguration中注入的bean出现冲突,导致环境启动失败。
Caused by: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'paginationInterceptor' defined in class path resource [org/springblade/core/boot/tenant/TenantConfiguration.class]: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springblade.core.boot.tenant.TenantConfiguration; factoryMethodName=paginationInterceptor; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springblade/core/boot/tenant/TenantConfiguration.class]] for bean 'paginationInterceptor': There is already [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springblade.core.boot.config.MybatisPlusConfiguration; factoryMethodName=paginationInterceptor; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springblade/core/boot/config/MybatisPlusConfiguration.class]] bound.
扫一扫访问 Blade技术社区 移动端