当前位置: 首页 > article >正文

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


http://www.kler.cn/a/152883.html

相关文章:

  • 〖大前端 - 基础入门三大核心之JS篇㊸〗- DOM事件对象及它的属性
  • Android进阶——更节电的后台任务JobScheduler 机制使用详解
  • 国家开放大学 平时作业 测试题 训练
  • 爬虫-响应状态码篇
  • Vue语音播报,不用安装任何包和插件,直接调用。
  • 多线程(初阶五:wait和notify)
  • Linux快捷控制
  • leetcode-160-相交链表(C语言实现)
  • 前端位运算
  • 用分布函数定义的随机变量的独立性的合理性
  • 助力android面试2024【面试题合集】
  • springBoot3.2 + jdk21 + GraalVM上手体验
  • 计算机硬件(二)
  • 大模型中的各种模型名词概念
  • 【开源】基于Vue+SpringBoot的高校宿舍调配管理系统
  • 【python笔记】与网络编程相关的知识总结
  • 生成对抗网络(GAN)手写数字生成
  • HarmonyOS应用开发者基础认证考试(98分答案)
  • MOS管的静电击穿问题
  • Clickhouse表引擎的总结