多数据源查询报错

Blade 已结 1 170
dp9212
dp9212 剑圣 2024-08-07 16:57

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

1. 多数据源查询第二个库数据报错

2. 使用DS注解选择的数据库

3.


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

正常返回响应,但日志看到会去 blade_scope_data和blade_role_scope两张表查询数据报错,

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

BladeX微服务 2.8.0 windows10

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

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database.  Cause: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select resource_code, scope_column, scope_field, scope_type, scope_value from blade_scope_data where scope_class = ? and id in (select scope_id from blade_role_scope where scope_category = 1 and role_id in (?))]; nested exception is java.sql.SQLSyntaxErrorException: Table 'government_affairs.blade_scope_data' doesn't exist

### Cause: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select resource_code, scope_column, scope_field, scope_type, scope_value from blade_scope_data where scope_class = ? and id in (select scope_id from blade_role_scope where scope_category = 1 and role_id in (?))]; nested exception is java.sql.SQLSyntaxErrorException: Table 'government_affairs.blade_scope_data' doesn't exist

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

1条回答
  •  admin
    admin (最佳回答者)
    2024-08-07 18:40

    bladex根目录执行mvn clean install后,在你切换的对应服务引入blade-scope-api依赖

    作者追问:2024-08-07 18:40

    执行mvn clean install后在当前项目引入blade-scope-api.jar,package的时候报错

    F:\gh\bh-community-intelligence-service\blade-service\intelligence-service\src\main\resources\lib\blade-scope-api.jar时出错; zip file is empty

    作者追问:2024-08-07 18:40

    image.png

    作者追问:2024-08-07 18:40

    本地环境测试是没有问题的,应该是打包没有打进去

    0 讨论(1)
提交回复