【已解决】KOCA登录用户初始化

KOCA版本 :4.0
KOCA模块 :用户初始化
模块版本 :4.0
场景 :我需要通过数据同步任务创建Koca的用户登录账号
问题 :需要初始化哪几张数据表才可以正常登录?我目前初始化了koca_user_info_base和koca_user_pwd,但是用生成的账号取登录提示登录失败了;
报错细节 :
尝试解决方案:

提供一些报错信息及日志

看一下后台异常堆栈信息


断到这里,对比一下密码


我关闭了验证码和随机码后登录出现了这个问题

项目里没有引用admin-user这个包

引入之后应该就OK了吧

我尝试一下

项目中引入了ID-GENERATOR的包
image
我后续再引入
image
的时候,出现了异常,主要是引入了admin-basic导致的,是我缺少了什么配置么?

看错误是少表了:

我们有配置2个数据源,默认的是RMS的我们自己业务的数据库,koca_sys_no这个在Koca的数据源是有这张表的

可能是数据库切换错了,可能访问到了RMS数据库

我们设置的数据源默认的是rms,启动时Koca的id-generator不会自动切koca么,还是要配置

参考这里:http://10.202.63.127:9000/koca-base_v4.2.0/Development_Boot/Database_Operation/Multiple_Data_Sources.html

不手动切就会访问默认的数据源

目前我的情况是,我们默认的数据源是RMS,但是我们引入了,KOCA的id-generator包,它这个Id生成需要依赖koca库的koca_sys_no,所以它到我们的rms的数据源配置的库里面去找这张表肯定是找不到的。但是我们没发改Koca源码去修改它读取的数据源,你们有什么办法规避么

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.szkingdom.koca.idgenerator.IdGenerator]: Factory method ‘autoIdGenerator’ threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘seqExStrategy’ defined in class path resource [com/szkingdom/koca/admin/idgenerator/config/SequenceConfiguration.class]: Unsatisfied dependency expressed through method ‘seqExStrategy’ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘core-default-sequence’ defined in class path resource [com/szkingdom/koca/admin/idgenerator/config/SequenceConfiguration.class]: Invocation of init method failed; nested exception is java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: Table ‘rms.koca_sys_no’ doesn’t exist
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
… 47 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘seqExStrategy’ defined in class path resource [com/szkingdom/koca/admin/idgenerator/config/SequenceConfiguration.class]: Unsatisfied dependency expressed through method ‘seqExStrategy’ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘core-default-sequence’ defined in class path resource [com/szkingdom/koca/admin/idgenerator/config/SequenceConfiguration.class]: Invocation of init method failed; nested exception is java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: Table ‘rms.koca_sys_no’ doesn’t exist

在你的RMS中创建koca_sys_no表应该能解决你的问题

试过了,它并不只是只需要这一张koca_sys_no表,创建了koca_sys_no表后他还对其他表有依赖,不可能把Koca的表全部都创建到对应的业务库里,请问有其他办法么,是不是没发修改id-generator对于数据源库的引用?

依赖这二张表: