当前使用版本(必填,否则不予处理)
v3.3.1
该问题是如何引起的?(确定最新版也有问题再提!!!)
使用最新版3.5.1试过,编译都通过不了。 项目启动后,登录页面输入用户名密码,执行登录时出现的
重现步骤(如果有就写完整)
项目架构:spring boot,nacos配置中心,Vue.js2.x版本 一般情况下项目中就连接一个数据库,但我的项目由于其他原因,目前需要由一个数据库改为连接两个数据库,所以找了一下资料,在nacos中配置了两个数据库的连接,如下: spring: datasource: primary: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver jdbc-url: jdbc:mysql://127.0.0.1:3306/? username: * password: * second: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver jdbc-url: jdbc:mysql://127.0.0.1:3306/? username: * password: * 然后新建了两个配置类,一个配置数据库primary的,另一个配置second的,在启动类中添加@EnableAutoConfiguration.....AutoConfigurationExcludeFilter.class,此外,还在各实体类上添加了@TableName注解。 项目启动正常,就是无法登录访问。
报错信息
ERROR [c.y.p.c.exception.GlobalExceptionHandlerResolver] - 全局异常信息 ex=error: can not execute. because can not find cache of TableInfo for entity! com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: error: can not execute. because can not find cache of TableInfo for entity! .............................. ERROR [c.y.p.c.exception.GlobalExceptionHandlerResolver] - 全局异常信息 ex=Invalid bound statement (not found): com.yngz.progress.provider.power.mapper.ProgressUserMapper.selectOne org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.yngz.progress.provider.power.mapper.ProgressUserMapper.selectOne ............................. ERROR [c.y.p.c.exception.GlobalExceptionHandlerResolver] - 全局异常信息 ex=error: can not execute. because can not find cache of TableInfo for entity! com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: error: can not execute. because can not find cache of TableInfo for entity!
Comment From: miemieYaho
多数据源建议用 https://github.com/baomidou/dynamic-datasource-spring-boot-starter 或者其他的,别自己撸
Comment From: XKFxiongkaifei
多数据源建议用 https://github.com/baomidou/dynamic-datasource-spring-boot-starter 或者其他的,别自己撸
非常感谢,使用您推荐的这个包已经解决了问题,学习了
Comment From: XKFxiongkaifei
非常感谢
| | 阿飞 | | @. | 在2022年7月1日 @.> 写道:
多数据源建议用 https://github.com/baomidou/dynamic-datasource-spring-boot-starter 或者其他的,别自己撸
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>