Skip to content

2.7.12 refresh metadata and instance failed #8061

@lkxiaolou

Description

@lkxiaolou
  • I have searched the issues of this repository and believe that this is not a duplicate.
    I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.12
  • Operating System version: macOS
  • Java version: 8

Steps to reproduce this issue

  1. dubbo-provider.xml
<dubbo:registry id="zkRegistry" protocol="zookeeper" address="127.0.0.1:2181">
        <dubbo:parameter key="registry-type" value="service"/>
</dubbo:registry>

<dubbo:metadata-report address="zookeeper://127.0.0.1:2181"/>

<dubbo:config-center address="zookeeper://127.0.0.1:2181"/>
  1. start provider
  2. print error log
2021-06-16 13:17:31,086 [Dubbo-framework-scheduler-thread-1] ERROR org.apache.dubbo.config.bootstrap.DubboBootstrap (DubboBootstrap.java:1172) -  [DUBBO] refresh metadata and instance failed, dubbo version: 2.7.12, current host: 172.23.233.52
java.lang.NullPointerException
	at org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataUtils.calInstanceRevision(ServiceInstanceMetadataUtils.java:249)
	at org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataUtils.lambda$refreshMetadataAndInstance$6(ServiceInstanceMetadataUtils.java:272)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataUtils.refreshMetadataAndInstance(ServiceInstanceMetadataUtils.java:271)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.lambda$registerServiceInstance$20(DubboBootstrap.java:1170)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

also 2.7.11 worked will, so i think this is a bug

Activity

lkxiaolou

lkxiaolou commented on Jun 16, 2021

@lkxiaolou
Author

I got the cause of the problem, in the org.apache.dubbo.registry.client.AbstractServiceDiscovery

2.7.11
image

2.7.12
image

ZookeeperServiceDiscovery depends on curator-x-discovery, but my project doesn't depends on, so doRegister cause exception, 2.7.12 exception first leads to null point exception

CrazyHZM

CrazyHZM commented on Jun 16, 2021

@CrazyHZM
Member

Please give your dependencies, it is generally recommended to directly rely on dubbo-registry-zookeeper.

lkxiaolou

lkxiaolou commented on Jun 16, 2021

@lkxiaolou
Author

Please give your dependencies, it is generally recommended to directly rely on dubbo-registry-zookeeper.

yes, add dubbo-registry-zookeeper works, but the error was confused, why not print class not found exception or log ?

AlbumenJ

AlbumenJ commented on Jun 21, 2021

@AlbumenJ
Member

Service Discovery model is no longer mantained in 2.7.x version, please upgrade to 3.0.x to using it.
If you found this issue still occurred in 3.0.x, please feel free to submit a new PR.

GreenPlumBoilAlcohol

GreenPlumBoilAlcohol commented on Jun 30, 2022

@GreenPlumBoilAlcohol

想使用dubbo这个RPC框架,但是参考官网中的测试用例和文档教程一直报错,各种报错,在排除了一堆后,还有一个始终无法解决的错误java.lang.NoClassDefFoundError: org/apache/curator/x/discovery/ServiceDiscoveryBuilder。看了你的评论后,加上了dubbo-registry-zookeeper依赖。终于正常运行了。非常感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lkxiaolou@AlbumenJ@CrazyHZM@GreenPlumBoilAlcohol

        Issue actions

          2.7.12 refresh metadata and instance failed · Issue #8061 · apache/dubbo