• Dubbo 3.0.3 + Nacos 2.0.3 + Spring Boot 2.3.6.RELEASE 整合及使用时遇到的问题


    Dubbo 3.0.3 + Nacos 2.0.3 + spring boot 2.3.6.RELEASE 整合中遇到的问题

    Dubbo 3.0.3 + Nacos 2.0.3 + spring boot 2.3.6.RELEASE 整合

    由于公司的一些老项目使用的rpc(是由HTTPClient封装的一个调用工具包),考虑到性能低,维护起来又极其难受。在众多rpc框架中对比发现,加上dubbo又推出了3.0版本,再加上目前各大企业都是采用dubbo作为rpc框架。故推翻现有的rpc,采用dubbo 3.0.3 来替换项目中的rpc框架,阅读各大网站、论坛,帖子发现dubbo 2.x版大多数使用的还是zookeeper作为rpc的注册中心,由于之前学习过spring cloud H版后发现 nacos 做为服务注册中心也是一个很不错的选择,所以此次升级也是采用了nacos 2.0

    项目框架搭建

    服务提供者

    pom.xml

    
    
        4.0.0
    
        org.example
        demo-provider
        1.0.0-SNAPSHOT
    
        
            org.springframework.boot
            spring-boot-dependencies
            2.3.6.RELEASE
        
    
        
            1.8
            UTF-8
            UTF-8
            2.3.6.RELEASE
            3.4.1
            1.1.21
            5.1.47
            3.0.3
            1.2.9
        
    
        
    
            
            
                org.example
                demo-interface
                1.0.0-SNAPSHOT
            
    
            
            
                org.springframework.boot
                spring-boot-starter-web
            
            
                org.springframework.boot
                spring-boot-starter-actuator
            
            
                org.springframework.boot
                spring-boot-starter-validation
            
            
                org.springframework.boot
                spring-boot-configuration-processor
            
    
            
            
                org.apache.dubbo
                dubbo-spring-boot-starter
                ${dubbo.version}
            
            
            
                org.apache.dubbo
                dubbo-registry-nacos
                ${dubbo.version}
            
    
            
            
                mysql
                mysql-connector-java
            
            
            
                com.alibaba
                druid-spring-boot-starter
                ${druid-spring-boot.version}
            
            
            
                com.baomidou
                mybatis-plus-boot-starter
                ${mybatis-plus-spring-boot.version}
            
    
            
            
                org.springframework.boot
                spring-boot-devtools
                runtime
                true
            
    
        
    
        
            demo-provider
            
                
                    org.apache.maven.plugins
                    maven-compiler-plugin
                    
                        ${java.version}
                        ${java.version}
                        ${project.build.sourceEncoding}
                    
                
                
                    org.springframework.boot
                    spring-boot-maven-plugin
                    
                        true
                        true
                        org.example.DemoApplication
                    
                    
                        
                            repackage
                            
                                repackage
                            
                        
                    
                
            
        
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129

    application.yml

    server:
      port: 8080
    
    spring:
      application:
        name: dubbo-demo-provider
      jackson:
        time-zone: GMT+8
        date-format: yyyy-MM-dd HH:mm:ss
      datasource:
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.jdbc.Driver
        url: jdbc:mysql://127.0.0.1:3306/demo?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&autoReconnectForPools=true&useSSL=false
        username: root
        password: 123456
        druid:
          initialSize: 5
          minIdle: 5
          maxActive: 20
          # 配置获取连接等待超时的时间
          maxWait: 60000
          # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
          timeBetweenEvictionRunsMillis: 60000
          # 配置一个连接在池中最小生存的时间,单位是毫秒
          minEvictableIdleTimeMillis: 300000
          validationQuery: select 'x'
          testWhileIdle: true
          testOnBorrow: false
          testOnReturn: false
          # 打开PSCache,并且指定每个连接上PSCache的大小
          poolPreparedStatements: true
          maxPoolPreparedStatementPerConnectionSize: 20
          # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
          filters: stat,wall,slf4j
          # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
          connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
    
    dubbo:
      application:
        name: dubbo-demo-provider
        # 禁用QOS同一台机器可能会有端口冲突现象
        qos-enable: false
        qos-accept-foreign-ip: false
      scan:
      	# 扫描rpc接口定义包
        base-packages: org.example.demo.service
      protocol:
        name: dubbo
        port: 8888
      registry:
        protocol: dubbo
        address: nacos://127.0.0.1:8848
        # 设置超时时间
        timeout: 3000
        # 配置 namespace
        parameters:
          namespace: 88b66463-1685-40b3-ba9c-7b25e526dcfb
         # 服务分组
        group: demo
    
    mybatis-plus:
      mapper-locations: classpath:/mapper/**Mapper.xml
      type-aliases-package: org.example.demo.entity #所有Entity别名类所在包
      configuration:
        log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
    
    logging:
      level:
        org.example.demo: debug
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69

    DemoServiceImpl.java

    @Slf4j
    @DubboService(version = "1.0")
    public class DemoServiceImpl implements DemoService{
    
        @Override
        public String test() {
            log.info("Hello Word");
            return "Hello Word";
        }
    
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    服务消费者

    pom.xml

    
    
        4.0.0
    
        org.example
        demo-consumer
        1.0.0-SNAPSHOT
    
        
            org.springframework.boot
            spring-boot-dependencies
            2.3.6.RELEASE
        
    
        
            UTF-8
            UTF-8
            1.8
            3.0.3
            1.2.9
        
    
        
    
            
                org.example
                demo-interface
                1.0.0-SNAPSHOT
            
    
            
                org.springframework.boot
                spring-boot-starter-web
            
    
            
                org.springframework.boot
                spring-boot-starter-actuator
            
    
            
                org.springframework.boot
                spring-boot-starter-validation
            
    
            
                org.springframework.boot
                spring-boot-configuration-processor
            
    
            
            
                org.apache.dubbo
                dubbo-spring-boot-starter
                ${dubbo.version}
            
            
            
                org.apache.dubbo
                dubbo-registry-nacos
                ${dubbo.version}
            
    
            
            
                org.springframework.boot
                spring-boot-devtools
                runtime
                true
            
    
            
                org.springframework.boot
                spring-boot-starter-test
                test
            
        
    
        
            demo-consumer
            
                
                    org.apache.maven.plugins
                    maven-compiler-plugin
                    
                        ${java.version}
                        ${java.version}
                        ${project.build.sourceEncoding}
                    
                
                
                    org.springframework.boot
                    spring-boot-maven-plugin
                    
                        
                        org.example.demo.DemoApiApplication
                    
                    
                        
                            
                                repackage
                            
                        
                    
                
            
        
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111

    application.yml

    server:
      port: 8181
    
    spring:
      application:
        name: dubbo-demo-consumer
      main:
        # 解决Bean重复定义问题
        allow-bean-definition-overriding: true
      jackson:
        time-zone: GMT+8
        date-format: yyyy-MM-dd HH:mm:ss
    
    dubbo:
      application:
        name: dubbo-demo-consumer
        # 禁用QOS同一台机器可能会有端口冲突现象
        qos-enable: false
        qos-accept-foreign-ip: false
      registry:
        address: nacos://127.0.0.1:8848
        # 配置 namespace
        parameters:
          namespace: 88b66463-1685-40b3-ba9c-7b25e526dcfb
        use-as-metadata-center: false
        use-as-config-center: false
        // 服务分组
        group: demo
      consumer:
    	# 服务连接超时时间
        timeout: 3000
        # 取消服务启动检查
        check: false
    
    logging:
      level:
        org.example.demo: debug
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37

    ConsumerService.java

    @Slf4j
    @Service
    public class ConsumerService{
    
    	@DubboReference(
                version = "1.0",
                loadbalance = "roundrobin"
        )
        private DemoService demoService;
    
    	/**
    	 * 此处完成服务调用
    	 */
    	public void test() {
            try {
    			String msg = demoService.test();
    			log.info("rpc 调用获取到的数据为:{}", msg)
            } catch (RpcException e) {
                log.error("rpc 调用数据失败,错误信息为:", e);
            }
            return null;
        }
    
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24

    没有啥特殊要求,至此配置完成,可以愉快的玩耍了

    Duplicate class org/apache/dubbo/remoting/exchange/Exchangers.class in 2 jar

    Duplicate class org/apache/dubbo/common/Version.class in 2 jar

    由于最近很火的一个日志(log4j和log4j2)致命漏洞,需要将生产项目中log4j相关漏洞进行修复,本来在最初知道 log4j2 的漏洞后还暗自笑过,因为受这个漏洞影响的项目中是使用了log4j2-core.jar,比如常见的在项目中应用了 spring-boot-starter-log4j2 相关的依赖,但是我的项目中没有使用到springboot的log4j2,所以暗自庆幸了一下。而比较旧的项目采用的spring-mvc 4.2.8,日志组件采用slf4j+log4j,spring-boot项目则是采用了官方的日志组件库 logback。但是紧跟着log4j2 漏洞出现后没过多久,Logback 也暴雷了,所以得升级改造。。。

    logback 漏洞: https://mp.weixin.qq.com/s/y10RXst0gRNZzmLyRt0GYA

    进入主题,首先spring-boot 2.3.6 使用的 logback是1.2.3
    需要将logback 升级到最新稳定版本 1.2.10
    需要将log4j2 升级到最新稳定版本 2.17.1 (视情况而定)
    查看spring-boot-dependencies里面规定当前依赖的版本 用的 key。
    在当前项目里面重写配置,如下面的代码,则可以替代默认的版本号。

    	
            1.2.10
            
            2.17.1
        
    
    • 1
    • 2
    • 3
    • 4
    • 5

    替换完之后发现项目中还有log4j的包,查看依赖后发现是 dubbo-registry-nacos 中使用到了log4j 1.2.6,在当前项目pom中进行移除。

    这里存在一个误解,就是log4j-api 本身并无安全问题,有问题的是log4j-core,而dubbo在3.0.x版本中并不依赖漏洞相关的包,故无需移除。
    参考地址:https://github.com/apache/dubbo/issues/9380

    下面问题产生的原因是由于移除了log4j依赖包 (未做移除的请忽略)

    	
                org.apache.dubbo
                dubbo-registry-nacos
                ${dubbo.version}
                
                    
                        log4j
                        log4j
                    
                
            
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    启动项目,发现了错误信息
    第一处错误

    2021-12-31 16:39:24.633 ERROR 7440 --- [  restartedMain] org.apache.dubbo.common.Version          :  [DUBBO] Duplicate class org/apache/dubbo/common/Version.class in 2 jar [file:/F:/repository/org/apache/dubbo/dubbo/3.0.3/dubbo-3.0.3.jar!/org/apache/dubbo/common/Version.class, file:/F:/repository/org/apache/dubbo/dubbo-common/3.0.3/dubbo-common-3.0.3.jar!/org/apache/dubbo/common/Version.class], dubbo version: 3.0.3, current host: 192.168.28.1
    2021-12-31 16:39:24.638  INFO 7440 --- [  restartedMain] d.s.b.c.e.WelcomeLogoApplicationListener : 
    
    • 1
    • 2

    第二处错误

    2021-12-31 16:39:32.886  WARN 7440 --- [  restartedMain] o.a.d.r.c.r.mesh.route.MeshRuleManager   :  [DUBBO] Doesn't support Configuration!, dubbo version: 3.0.3, current host: 192.168.28.1
    2021-12-31 16:39:32.897 ERROR 7440 --- [  restartedMain] org.apache.dubbo.common.Version          :  [DUBBO] Duplicate class org/apache/dubbo/remoting/exchange/Exchangers.class in 2 jar [file:/F:/repository/org/apache/dubbo/dubbo/3.0.3/dubbo-3.0.3.jar!/org/apache/dubbo/remoting/exchange/Exchangers.class, file:/F:/repository/org/apache/dubbo/dubbo-remoting-api/3.0.3/dubbo-remoting-api-3.0.3.jar!/org/apache/dubbo/remoting/exchange/Exchangers.class], dubbo version: 3.0.3, current host: 192.168.28.1
    2021-12-31 16:39:32.908 ERROR 7440 --- [  restartedMain] org.apache.dubbo.common.Version          :  [DUBBO] Duplicate class org/apache/dubbo/remoting/Transporters.class in 2 jar [file:/F:/repository/org/apache/dubbo/dubbo/3.0.3/dubbo-3.0.3.jar!/org/apache/dubbo/remoting/Transporters.class, file:/F:/repository/org/apache/dubbo/dubbo-remoting-api/3.0.3/dubbo-remoting-api-3.0.3.jar!/org/apache/dubbo/remoting/Transporters.class], dubbo version: 3.0.3, current host: 192.168.28.1
    2021-12-31 16:39:32.908 ERROR 7440 --- [  restartedMain] org.apache.dubbo.common.Version          :  [DUBBO] Duplicate class org/apache/dubbo/remoting/RemotingException.class in 2 jar [file:/F:/repository/org/apache/dubbo/dubbo-remoting-api/3.0.3/dubbo-remoting-api-3.0.3.jar!/org/apache/dubbo/remoting/RemotingException.class, file:/F:/repository/org/apache/dubbo/dubbo/3.0.3/dubbo-3.0.3.jar!/org/apache/dubbo/remoting/RemotingException.class], dubbo version: 3.0.3, current host: 192.168.28.1
    
    • 1
    • 2
    • 3
    • 4

    解决方法:
    引入dubbo相关的依赖时,会有依赖传递,必须要exclude相关冲突的资源
    参考:https://github.com/apache/dubbo-spring-boot-project/issues/227

    		
                org.apache.dubbo
                dubbo-registry-nacos
                ${dubbo.version}
                
                    
                        org.apache.dubbo
                        dubbo-common
                    
                    
                        org.apache.dubbo
                        dubbo-remoting-api
                    
                    
                        log4j
                        log4j
                    
                
            
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19

    [dubbo] the metadata report was not initialized.

    去掉log4j 导致 dubbo 启动错误

    2021-12-31 16:39:33.247  WARN 7440 --- [  restartedMain] o.a.d.r.client.ServiceDiscoveryRegistry  :  [DUBBO] Cannot find app mapping for service tm.ucp.service.MeetingRecordingService, will not migrate., dubbo version: 3.0.3, current host: 192.168.28.1
    
    java.lang.IllegalStateException: the metadata report was not initialized.
    	at org.apache.dubbo.metadata.report.MetadataReportInstance.checkInit(MetadataReportInstance.java:88) ~[dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.metadata.report.MetadataReportInstance.getMetadataReport(MetadataReportInstance.java:77) ~[dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.client.metadata.MetadataServiceNameMapping.getAndListen(MetadataServiceNameMapping.java:107) ~[dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.metadata.AbstractServiceNameMapping.getAndListenServices(AbstractServiceNameMapping.java:101) ~[dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.doSubscribe(ServiceDiscoveryRegistry.java:215) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribe(ServiceDiscoveryRegistry.java:204) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:109) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.integration.DynamicDirectory.subscribe(DynamicDirectory.java:160) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.subscribe(ServiceDiscoveryRegistryDirectory.java:104) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.integration.RegistryProtocol.doCreateInvoker(RegistryProtocol.java:557) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol.getServiceDiscoveryInvoker(InterfaceCompatibleRegistryProtocol.java:65) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.client.migration.MigrationInvoker.refreshServiceDiscoveryInvoker(MigrationInvoker.java:424) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.client.migration.MigrationInvoker.migrateToApplicationFirstInvoker(MigrationInvoker.java:240) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.refreshInvoker(MigrationRuleHandler.java:72) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.doMigrate(MigrationRuleHandler.java:56) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.client.migration.MigrationRuleListener.onRefer(MigrationRuleListener.java:233) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.integration.RegistryProtocol.interceptInvoker(RegistryProtocol.java:526) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:495) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:480) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:83) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:74) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:71) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.config.ReferenceConfig.createInvokerForRemote(ReferenceConfig.java:469) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:380) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:267) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:204) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.config.spring.ReferenceBean.getCallProxy(ReferenceBean.java:348) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.config.spring.ReferenceBean.access$100(ReferenceBean.java:98) [dubbo-3.0.3.jar:3.0.3]
    	at org.apache.dubbo.config.spring.ReferenceBean$DubboReferenceLazyInitTargetSource.createObject(ReferenceBean.java:355) [dubbo-3.0.3.jar:3.0.3]
    	at org.springframework.aop.target.AbstractLazyCreationTargetSource.getTarget(AbstractLazyCreationTargetSource.java:88) [spring-aop-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:192) [spring-aop-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at com.sun.proxy.$Proxy142.listByUntreated(Unknown Source) [na:na]
    	at tm.mye.mobile.rpc.server.GroupMeetingServiceImpl.getMeetingRecordingByUntreated(GroupMeetingServiceImpl.java:192) [classes/:na]
    	at tm.mye.mobile.uap.server.TaskService.scheduleTask(TaskService.java:41) [classes/:na]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
    	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
    	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:415) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1786) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeanByName(AbstractAutowireCapableBeanFactory.java:453) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:527) ~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:497) ~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:650) ~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:229) ~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:318) ~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeanByName(AbstractAutowireCapableBeanFactory.java:453) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:527) ~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:497) ~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:650) ~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:229) ~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:318) ~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]
    	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]
    	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]
    	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) ~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]
    	at tm.mye.mobile.MobileApiApplication.main(MobileApiApplication.java:20) ~[classes/:na]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
    	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
    	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.3.6.RELEASE.jar:2.3.6.RELEASE]
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98

    解决metadata report 初始化错误:
    修改项目 application.yml

    dubbo:
      registry:
        address: nacos://127.0.0.1:8848
      # 配置dubbo 元数据
      metadata-report:
        address: nacos://127.0.0.1:8848
        group: demo
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    元数据中心用于存储一些服务提供者、消费者的信息,比如dubbo版本、服务接口的信息(包括方法名、形参表、返回值类型)等等。

  • 相关阅读:
    C++ QT QLocalSocket/QLocalServer基操
    STM32中的加速度计驱动程序与姿态控制实现
    IP协议-NAT机制(理解网络结构的关键要点)
    【C语言】真假只知道0/1,肤浅了吧(每日小细节005)
    带你认识图数据库性能和场景测试利器LDBC SNB
    Java IO---字节流和字符流
    Linux常用指令和选项(一)
    springboot 集成 PageHelper 分页失效
    面试:自定义view / viewgroup 相关问题
    校园论坛设计(Java)——介绍篇
  • 原文地址:https://blog.csdn.net/m0_54849806/article/details/126327710