启动服务遇到的问题

来源:6-4 结合商城下单场景下分析Seata AT模式流程

及时的斯托同学

2022-09-24

老师您好 我这边启动MallGoods服务遇到两个问题

  1. 使用Druid数据源时启动报错:
java.lang.NoClassDefFoundError: org/springframework/boot/bind/RelaxedDataBinder

搜索了一下发现似乎因为Druid不兼容springboot 2.x, 请问老师您是否遇到这个问题呢?

  1. 注释掉Druid依赖,服务可以启动,不过运行后,控制台log如下error
2022-09-24 15:02:58.423 ERROR 14836 --- [eoutChecker_1_1] i.s.c.r.netty.NettyClientChannelManager  : can not get cluster name in registry config 'service.vgroupMapping.mall-goods-seata-service-group', please make sure registry config correct
2022-09-24 15:02:58.427 ERROR 14836 --- [eoutChecker_2_1] i.s.c.r.netty.NettyClientChannelManager  : can not get cluster name in registry config 'service.vgroupMapping.mall-goods-seata-service-group', please make sure registry config correct
2022-09-24 15:03:08.413 ERROR 14836 --- [eoutChecker_1_1] i.s.c.r.netty.NettyClientChannelManager  : can not get cluster name in registry config 'service.vgroupMapping.mall-goods-seata-service-group', please make sure registry config correct
2022-09-24 15:03:08.424 ERROR 14836 --- [eoutChecker_2_1] i.s.c.r.netty.NettyClientChannelManager  : can not get cluster name in registry config 'service.vgroupMapping.mall-goods-seata-service-group', please make sure registry config correct
2022-09-24 15:03:18.414 ERROR 14836 --- [eoutChecker_1_1] i.s.c.r.netty.NettyClientChannelManager  : can not get cluster name in registry config 'service.vgroupMapping.mall-goods-seata-service-group', please make sure registry config correct
2022-09-24 15:03:18.426 ERROR 14836 --- [eoutChecker_2_1] i.s.c.r.netty.NettyClientChannelManager  : can not get cluster name in registry config 'service.vgroupMapping.mall-goods-seata-service-group', please make sure registry config correct

由于课程推进到这里还没有涉及到nacos的内容,因此我使用了file方式进行配置,且服务端启动是成功的:

23:14:59.028  INFO --- [                     main] io.seata.config.FileConfiguration        : The file name of the operation is registry
23:14:59.037  INFO --- [                     main] io.seata.config.FileConfiguration        : The configuration file used is /usr/local/seata/seata/seata-server-1.4.2/conf/registry.conf
23:14:59.129  INFO --- [                     main] io.seata.config.FileConfiguration        : The file name of the operation is file.conf
23:14:59.129  INFO --- [                     main] io.seata.config.FileConfiguration        : The configuration file used is /usr/local/seata/seata/seata-server-1.4.2/conf/file.conf
23:14:59.687  INFO --- [                     main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited
23:14:59.928  INFO --- [                     main] i.s.core.rpc.netty.NettyServerBootstrap  : Server started, listen port: 8091

请问老师,是否要添加一些配置项在项目中呢?
期待老师的解答~ (和新版本的代码)

写回答

2回答

大能老师

2022-09-24

同学你好,关于Seata章节的学习,首先代码要切换到 Seata 分支,而不是在 master 分支

然后关于环境搭建,可以参考一下这两个文件:

【Nacos环境搭建教材v2.0】和【Seata启动Server】

由于这个问答区没有办法上传文件,我把文件放到QQ群的群文件里面了,麻烦同学到QQ群(713718851)获取一下这两个文件。

//img.mukewang.com/szimg/632f1653094c766510400952.jpg

0
1
及时的斯托同学
感谢老师
2022-09-24
共1条回复

及时的斯托同学

提问者

2022-09-24

关于第一个Druid数据源的问题,尝试着提高Druid的版本到1.2.12,可以解决~

0
0

Java分布式架构设计与开发实战

项目贯穿式讲解,真正将理论与实战相结合

325 学习 · 74 问题

查看课程