Seata:Could not found property service.disableGlobalTransaction, try to use default value instead

参考:https://github.com/seata/seata/issues/2114

1、问题

在启动一个Seata项目时,报错如下:
在这里插入图片描述
提示没有发现service.disableGlobalTransaction这个属性,但我在application.yml文件中已经配置了该属性,如下图:
Seata:Could not found property service.disableGlobalTransaction, try to use default value instead_第1张图片
但如果将这个属性的值设置为true,则可以正常启动该Seata项目,但如果属性值为true则表示不开启全局事务,而我要实现全局事务。

2、解决方案

查询相关资料,最终的解决方式是在resources目录下创建file.conf文件:
Seata:Could not found property service.disableGlobalTransaction, try to use default value instead_第2张图片
file.conf文件内容如下:
在这里插入图片描述
至此,可以正常启动Seata项目,不再报Could not found property service.disableGlobalTransaction, try to use default value instead错误。

3、其他解决方案

除此之外,我在网上还查询了相关资料,大致是这么个意思:在yml格式的配置中件中配置service.disableGlobalTransaction属性会无效,需创建file.conf文件在该文件中指定service.disableGlobalTransaction属性的值;或者使用properties格式的配置文件代替yml格式的配置文件(但我没有对这种说法进行验证)。

你可能感兴趣的:(微服务架构)