seata集成springboot的一些错误小计

1 seata依赖没找到

'dependencies.dependency.version' for com.alibaba.cloud:spring-cloud-starter-alibaba-seata:jar is missing. @ line 126, column 21

错误原因:未指定具体的seata版本
解决

 <!-- https://mvnrepository.com/artifact/com.alibaba.cloud/spring-cloud-starter-alibaba-seata -->
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
            <version>2021.1</version>
            <exclusions>
                <!--版本较低,1.3.0,因此排除-->
                <exclusion>
                    <artifactId>seata-spring-boot-starter</artifactId>
                    <groupId>io.seata</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- https://mvnrepository.com/artifact/io.seata/seata-spring-boot-starter -->
        <dependency>
            <groupId>io.seata</groupId>
            <artifactId>seata-spring-boot-starter</artifactId>
            <version>1.4.2</version>
        </dependency>

2 applicationId: null, txServiceGroup: null-seata-service-group
错误原因:未指定当前服务名
解决:

spring:
    application:
        name: xxx

3 can not get cluster name in registry config ‘service.vgroupMapping.xxx-seata-service-group‘
错误原因: 事务组配置错误,yml没有和配置文件registry.conf中正确对应
解决:
yml配置

    tx-service-group: seata-demo # 事务组名称
    service:
        vgroup-mapping:
            seata-demo: BJ

conf配置

  nacos {
    application = "seata-server"
    serverAddr = "1.27.0.0.1:8848"
    group = "DEFAULT_GROUP"
    namespace = ""
    cluster = "BJ"
    username = "nacos"
    password = "nacos"
  } 
}

nacos中事务组配置
在这里插入图片描述
4 seata报错: 0304 register RM failed.
错误原因:linux部署 启动参数错误 0304代表内网错误 正确的启动参数为:
seata-server.sh -h {ip} -p 8091 不能直接使用seata-server.sh

5 @GlobalTransactional 未生效
1 原因: @GlobalTransactional 是通过 AOP 实现的,只有通过代理调用的方法才会被 AOP 增强。不能使用this
2 多个服务间的调用所有相关服务都必须配置seata

  • 9
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值