集成多数据源报错

Blade 已结 2 910
xutianshun
xutianshun 剑童 2021-08-24 16:45

一、该问题的重现步骤是什么?

1. 

2. 

3.配置了多数据源,启动后报错


二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

bladex-boot 商业班2.8.1 windows10

四、请提供详细的错误堆栈信息,这很重要。

Description:


URL [jar:file:/C:/Users/xts/.m2/repository/org/springblade/blade-starter-report/2.8.1.RELEASE/blade-starter-report-2.8.1.RELEASE.jar!/org/springblade/core/report/mapper/ReportFileMapper.class] required a single bean, but 4 were found:

- sqlSessionFactory: defined by method 'sqlSessionFactory' in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]

- erpliteSqlSessionFactory: defined by method 'sqlSessionFactory' in class path resource [org/springblade/common/config/ErpliteDataSourceConfig.class]

- masterSqlSessionFactory: defined by method 'sqlSessionFactory' in class path resource [org/springblade/common/config/MasterDataSourceConfig.class]

- nerpSqlSessionFactory: defined by method 'sqlSessionFactory' in class path resource [org/springblade/common/config/NerpDataSourceConfig.class]



Action:


Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed



Process finished with exit code 1

五、若有更多详细信息,请在下面提供。

2条回答
  •  zhx1994
    zhx1994 (最佳回答者)
    2021-08-24 17:38

    https://sns.bladex.cn/q-1791.html

    0 讨论(1)
  • 2021-08-31 16:44

    解决

    0 讨论(0)
提交回复