微服务 记录报错日常

之前一直在做谷粒商城,确实学到了不少知识点,还有黑马的一个微服务全栈课程(哔哩哔哩有)感觉学了不少,eruka、nacos、feign、rabbitmq、es但是吧,一直往下学,感觉之前学过的知识点又不太清晰了就准备了这个小项目试试水,结果...泪目了

springboot、springcloud、springcloud alibaba版本不匹配


这个错误仅代表其中一种,意思就是版本不匹配大部分的错误都是版本不匹配、冲突造成如java.lang.AbstractMethodError: null、等折磨了我半天在博客上找了好多所谓的“毕业版本依赖关系(推介使用)”然后就是不停的报java.lang.AbstractMethodError: null这个错网上说是由于版本不匹配造成,项目根本跑不起来

github上有版本说明,详情查看

Spring Cloud Alibaba Version

Spring Cloud Version

Spring Boot Version

2021.0.4.0*

Spring Cloud 2021.0.4

2.6.11

2021.0.1.0

Spring Cloud 2021.0.1

2.6.3

2021.1

Spring Cloud 2020.0.1

2.4.2

2.2.10-RC1*

Spring Cloud Hoxton.SR12

2.3.12.RELEASE

2.2.9.RELEASE

Spring Cloud Hoxton.SR12

2.3.12.RELEASE

2.2.8.RELEASE

Spring Cloud Hoxton.SR12

2.3.12.RELEASE

2.2.7.RELEASE

Spring Cloud Hoxton.SR12

2.3.12.RELEASE

2.2.6.RELEASE

Spring Cloud Hoxton.SR9

2.3.2.RELEASE

2.2.1.RELEASE

Spring Cloud Hoxton.SR3

2.2.5.RELEASE

2.2.0.RELEASE

Spring Cloud Hoxton.RELEASE

2.2.X.RELEASE

2.1.4.RELEASE

Spring Cloud Greenwich.SR6

2.1.13.RELEASE

2.1.2.RELEASE

Spring Cloud Greenwich

2.1.X.RELEASE

2.0.4.RELEASE(停止维护,建议升级)

Spring Cloud Finchley

2.0.X.RELEASE

1.5.1.RELEASE(停止维护,建议升级)

Spring Cloud Edgware

1.5.X.RELEASE

Spring Cloud Alibaba Version

Sentinel Version

Nacos Version

RocketMQ Version

Dubbo Version

Seata Version

2.2.10-RC1

1.8.6

2.2.0

4.9.4

~

1.6.1

2022.0.0.0-RC1

1.8.6

2.2.1-RC

4.9.4

~

1.6.1

2.2.9.RELEASE

1.8.5

2.1.0

4.9.4

~

1.5.2

2021.0.4.0

1.8.5

2.0.4

4.9.4

~

1.5.2

2.2.8.RELEASE

1.8.4

2.1.0

4.9.3

~

1.5.1

2021.0.1.0

1.8.3

1.4.2

4.9.2

~

1.4.2

2.2.7.RELEASE

1.8.1

2.0.3

4.6.1

2.7.13

1.3.0

2.2.6.RELEASE

1.8.1

1.4.2

4.4.0

2.7.8

1.3.0

2021.1 or 2.2.5.RELEASE or 2.1.4.RELEASE or 2.0.4.RELEASE

1.8.0

1.4.1

4.4.0

2.7.8

1.3.0

2.2.3.RELEASE or 2.1.3.RELEASE or 2.0.3.RELEASE

1.8.0

1.3.3

4.4.0

2.7.8

1.3.0

2.2.1.RELEASE or 2.1.2.RELEASE or 2.0.2.RELEASE

1.7.1

1.2.1

4.4.0

2.7.6

1.2.0

2.2.0.RELEASE

1.7.1

1.1.4

4.4.0

2.7.4.1

1.0.0

2.1.1.RELEASE or 2.0.1.RELEASE or 1.5.1.RELEASE

1.7.0

1.1.4

4.4.0

2.7.3

0.9.0

2.1.0.RELEASE or 2.0.0.RELEASE or 1.5.0.RELEASE

1.6.3

1.1.1

4.4.0

2.7.3

0.7.1

这里我用的是 2.3.12.RELEASE的springbootHoxton.SR12的springcloud2.2.9.RELEASE的springcloud alibaba,但是有个需要注意的地方, nacos的版本需要在2.1.0,我以前用的nacos是1.4.1,报错nacos版本不匹配, 详情查看
com.alibaba.nacos.api.exception.NacosException: Request nacos server failed: 

这里我找了好多博文,发现了这样一篇,原文连接

<dependencyManagement>
        <dependencies>
            <!--spring boot-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!--spring cloud-->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!--spring cloud alibaba-->
            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>${spring-cloud-alibaba.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
</dependencyManagement>

我一直以来并不是这种写法,而是如下写法

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.12.RELEASE</version>
        <relativePath/><!-- lookup parent from repository -->
    </parent>

第一次发现还有这种写法,记录一下

人人开源-代码生成--500


老实说,这些谷粒商城的视频里都有,时间太久,我有些记不清了
在url地址栏输入localhost:80,之后回车,变成了localhost,报500看到了这样一篇 博客和博主是一样的问题解决方法: http://localhost:/index.html

人人开源-代码生成--serviceimpl报错


看到了一篇博客,说是导包的问题

我看了又看,包没有什么问题,并不是这个原因
接下来又看到了这篇 博客的p17,是一个大佬记录自己的谷粒商城踩坑记录
第17条, serviceImpl 分页代码报错问题,那是因为你copy代码的时候去的是renrengenerator模块,应该去renrenfast 里面copy
恍然大悟,确实是这样,解决方法就是去renren-fast里复制
以前没注意到这个问题,没踩过这个坑,现在终于补齐了...

open feign返回值为null


feign的调用是成功了一半,可以看到user服务已经查询到了,但奇怪的是vacc服务没接收到
上网搜了一下为null的情况, 查看
对比了一下自己的代码, @EnableFeignClients、@EnableDiscoveryClient、@FeignClient("vaccine-user")
注解该在的都在,不是这个问题
“返回数据中多对一实体中还包含了一对多的关系也会返回null”,我之前数据库里确实有写一对多的数据本来是想试验一下来着,但仔细一看代码,不是这个问题
错误原因:返回值的问题,被调用的方法的返回值是renren-fast的R,但clients接口的返回值是User
这个就是纯纯粗心了,太憨了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值