bladex配置多数据源mysql和oracle,提示 ORA-00942: 表或视图不存在

Blade 未结 1 1984
vito
vito 2020-12-09 11:45

一、

blade_role_scope 这个表在mysql数据库呢,不应该报oracle类型的错误啊,难道他默认去oracle数据库中查找了?

image.png


image.png


### 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: ORA-00942: 表或视图不存在


at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)

... 113 more

Caused by: 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: ORA-00942: 表或视图不存在


at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:235)

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)

at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1443)

at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:633)

at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:669)

at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:700)

at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712)

at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:763)

at org.springblade.core.datascope.handler.BladeScopeModelHandler.getDataScopeByMapper(BladeScopeModelHandler.java:63)

at org.springblade.core.datascope.handler.BladeDataScopeHandler.sqlCondition(BladeDataScopeHandler.java:50)

at org.springblade.core.datascope.interceptor.DataScopeInterceptor.intercept(DataScopeInterceptor.java:109)

at org.springblade.core.mp.plugins.QueryInterceptorExecutor.exec(QueryInterceptorExecutor.java:46)

at org.springblade.core.mp.plugins.PaginationInterceptor.intercept(PaginationInterceptor.java:164)

at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)

at com.sun.proxy.$Proxy186.prepare(Unknown Source)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)

at com.sun.proxy.$Proxy186.prepare(Unknown Source)

at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.prepareStatement(MybatisSimpleExecutor.java:94)

at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:66)

at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)

at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)

at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:136)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)

... 119 more


1条回答
  •  zhx1994
    zhx1994 (楼主)
    2020-12-09 13:58

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

    0 讨论(0)
提交回复