首页 > 其他分享 >【达梦8大小版本更换后适配flowable6.8报错Error initialising eventregistry data model】

【达梦8大小版本更换后适配flowable6.8报错Error initialising eventregistry data model】

时间:2023-11-16 18:56:02浏览次数:26  
标签:return flowable 适配 数据库 报错 getDatabaseMinorVersion Error

达梦8大小版本更换后适配flowable6.8报错

问题背景:

当前代码使用达梦8并适配了flowable6.8工作流,在达梦8小版本2021版更新到达梦8小版本2023后出现报错,报错如下:

 - Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'wfDeployController' defined in file [F:\Zoe\flowable\ruoyi-flowable-plus\ruoyi-admin\target\classes\com\ruoyi\web\controller\workflow\WfDeployController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'wfDeployServiceImpl' defined in file [F:\Zoe\flowable\ruoyi-flowable-plus\ruoyi-system\target\classes\com\ruoyi\workflow\service\impl\WfDeployServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'repositoryServiceBean' defined in class path resource [org/flowable/spring/boot/ProcessEngineServicesAutoConfiguration.class]: Unsatisfied dependency expressed through method 'repositoryServiceBean' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.flowable.common.engine.api.FlowableException: Error initialising eventregistry data model

再往下看报错,还有更具体的报错:

Caused by: java.lang.NumberFormatException: For input string: ""

.............

at liquibase.database.core.DmDatabase.getDatabaseMinorVersion(DmDatabase.java:172)

新数据库版本:20230927 开发版

select *,id_code from v$version;
--03134284094-20230927-203585-20067 Pack1

旧数据库版本:20211021 开发版

select *,id_code from v$version;
-- 1-2-84-21.10.21-149328-10032-ENT 

问题排查:

​ 首先我没有删除旧版本的数据库,所以我现在运行了两个数据库实例,当我把配置文件对应数据库配置换成原来的配置,则报错消失。

​ 然后我发现DmDatabase.java这个类是我之前做flowable与达梦数据库适配时新建的类(包路径:package liquibase.database.core,是liquibase包代码重写),里面有次版本号获取方法:

    @Override
    public int getDatabaseMinorVersion() throws DatabaseException {
        if (databaseMinorVersion == null) {
            return super.getDatabaseMinorVersion();
        } else {
            return databaseMinorVersion;
        }
    }

这个databaseMinorVersion是null,我沿着父类AbstractJdbcDatabase的getDatabaseMinorVersion()方法追踪,可以找到 DmdbDatabaseMetaData.java类,

public class DmdbDatabaseMetaData extends Filterable implements DatabaseMetaData  {}

最后定位到方法do_getDatabaseMinorVersion:

方法路径:dm.jdbc.driver.DmdbDatabaseMetaData#do_getDatabaseMinorVersion

方法内容:

    public int do_getDatabaseMinorVersion() {
        if (this.connection.compatibleOracle()) {
            return 1;
        } else {
            String[] var1 = this.do_getDatabaseProductVersion().split("\\.");
            return Integer.parseInt(var1[1]);
        }
    }

开启debug,可以看到如果if走的true判断,则返回1,如果走else部分,var1的值为["8", "", "", "03134284094"],这就导致var1[1]时因为获取下标内容是空串,所以转为int时自然报错NumberFormatException

https://blog.csdn.net/qq_35349982/article/details/129624838

问题解决:

目前来说可能是当前数据库版本解析异常或者没有按照oracle走适配:connection.compatibleOracle

第一种:

添加数据库配置URL的参数:&compatibleMode=oracle

url: jdbc:dm://localhost:5237/PSPG_DEV?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle

第二种:

重写liquibase时手动把数据库版本赋值,比如

@Override
public int getDatabaseMinorVersion() throws DatabaseException {
    if (databaseMinorVersion == null) {
        // 如果当达梦数据库的小版本更换后如果报错定位到这里,可以考虑次版本号赋值为1(直接return 1)
        // return super.getDatabaseMinorVersion();
        // return 1;
    } else {
        return databaseMinorVersion;
    }
}

思考:

报错信息追踪还是很有必要的(笑

标签:return,flowable,适配,数据库,报错,getDatabaseMinorVersion,Error
From: https://www.cnblogs.com/dabuliu/p/17837029.html

相关文章

  • 使用MobaTextEditor编辑的代码在linux上运行报错
    在windows上通过ssh登录linux节点处理数据,使用MobaTextEditor编辑shell脚本后,在linux上运行总是报错找不到路径 报错 其根本原因是windows下每一行的结尾符是\n\r,而linux下是\n,所以windows下编写的shell脚本拷贝到linux下时会多一个\r,在运行时会乱码在运行前通过以下命令......
  • error DatabaseException(disk I/O error (code 1802)) sql 'PRAGMA user_version' ar
    问题描述errorDatabaseException(diskI/Oerror(code1802))sql'PRAGMAuser_version'args[]duringopen,c问题分析错误消息"DatabaseException(diskI/Oerror(code1802))"表示在尝试打开SQLite数据库时发生了磁盘I/O错误。这可能有几种原因:数据库文件路径......
  • git clone报错SSL connect error
    解决CentOS6.6上Git操作引发的SSL连接错误问题最近在处理一个CentOS6.6服务器上的问题时,遇到了一个比较棘手的问题。我的小伙伴在操作Git时,发现无法执行gitpull命令,提示找不到Git组件。在这篇文章中,我会详细介绍我们是如何定位和解决这个问题的。问题描述在一个已经很久没有......
  • 解决执行pytest -vs test.py报错问题
    报错如下:解决方案:在终端中执行python-mpytest+后面你想运行的命令,如下:python-mpytesttest.py......
  • mysql链接不上3306报错10060
    1、控制台进入查看防火墙(前提mysql我的端口是3306,现在大部分人已经不用3306了)firewall-cmd--zone=public--list-ports(查看3306端口是否开启,如果没见到3306端口)2、添加3306firewall-cmd--zone=public--add-port=3306/tcp--parmanent3、如上添加成功了,最重要的一点来......
  • SAP调用外部的REST服务 http_communication_failure Connection to partner timed
    SAP中主动调用外部的REST服务时候, 因为传输的数据量比较大, 所以报Connectiontopartnertimedoutafter60 这一错误,原因之一可能是Tcode-SMICM ->转到->服务设置保活和处理超时时间,秒为单位,可以更具自己的需求进行设置。......
  • gin-vue-admin 接口错误Error: Request failed with status code 500
    本地运行以后登录出现:控制台检查发现是请求getMenu出现500错误,并且后端出现"Error1071(42000):Specifiedkeywastoolong;maxkeylengthis1000bytes"错误,那就是数据库casbin_rule的表引擎不是InnoDB,更改成InnoDB即可。ALTERTABLEcasbin_ruleENGINE=InnoDB;......
  • git 报错。
    在下载的 linux的源码上进行gitinit的时候报错。  fatal:Invalidpath'/home/topeet/source_code/xikejiqiren/3588-linux/.repo':Nosuchfileordirectory 这是可能的原因。  ......
  • Thread was being aborted Errors
    "executionTimeout"inthemachine.cofig<system.web><httpRuntimeexecutionTimeout="3600"/></system.web>TheproblemissolvedafteryoudeletetheencryptedcontentforSQlServer2008.Itworkedfor......
  • An error has occurred during report processing
    ex.Message:Anerrorhasoccurredduringreportprocessing.ex.Source:Microsoft.ReportViewer.WebFormsex.StackTrace:  at Microsoft.Reporting.WebForms.LocalReport.InternalRender(Stringformat,BooleanallowInternalRenderers,StringdeviceInfo,CreateAn......