Skip to content

dubbo 2.7.1-SNAPSHOT NoClassDefFoundError when use springboot #3426

Closed

Description

@GrayWind33
  • 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.1-SNAPSHOT
  • Operating System version: MacOS
  • Java version: 1.8

Steps to reproduce this issue

  1. add latest dubbo version and spring-boot-starter-dubbo
  2. try to start springboot
  3. java.lang.NoClassDefFoundError: org/apache/curator/retry/ExponentialBackoffRetry

Actual Result

java.lang.NoClassDefFoundError: org/apache/curator/retry/ExponentialBackoffRetry
	at org.apache.dubbo.configcenter.support.zookeeper.ZookeeperDynamicConfiguration.<init>(ZookeeperDynamicConfiguration.java:64) ~[dubbo-2.7.1-SNAPSHOT.jar:2.7.1-SNAPSHOT]
	at org.apache.dubbo.configcenter.support.zookeeper.ZookeeperDynamicConfigurationFactory.createDynamicConfiguration(ZookeeperDynamicConfigurationFactory.java:29) ~[dubbo-2.7.1-SNAPSHOT.jar:2.7.1-SNAPSHOT]
	at org.apache.dubbo.configcenter.AbstractDynamicConfigurationFactory.getDynamicConfiguration(AbstractDynamicConfigurationFactory.java:33) ~[dubbo-2.7.1-SNAPSHOT.jar:2.7.1-SNAPSHOT]...

Have to manually add curator-framework and curator-recipes and then it starts successfully. But it seems not convenient. Any problem with the pom.xml setting?
必须手动增加curator-framework和curator-recipes两个依赖,否则无法通过springboot启动,请问下是配置有问题吗
The dependency:

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.dubbo</groupId>
      <artifactId>dubbo</artifactId>
      <version>2.7.1-SNAPSHOT</version>
    </dependency>

    <dependency>
      <groupId>io.dubbo.springboot</groupId>
      <artifactId>spring-boot-starter-dubbo</artifactId>
      <version>1.0.0</version>
      <exclusions>
        <exclusion>
          <groupId>com.alibaba</groupId>
          <artifactId>dubbo</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.apache.curator</groupId>
      <artifactId>curator-framework</artifactId>
      <version>4.0.1</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.zookeeper</groupId>
          <artifactId>zookeeper</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.curator</groupId>
      <artifactId>curator-recipes</artifactId>
      <version>4.0.1</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.zookeeper</groupId>
          <artifactId>zookeeper</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

Activity

  1. LiZhenNet commented on Feb 12, 2019

    @LiZhenNet
    Contributor

    可以看一下示例:https://github.com/apache/incubator-dubbo-spring-boot-project/tree/master/dubbo-spring-boot-samples
    应该仅仅添加:

      <groupId>org.apache.curator</groupId>
      <artifactId>curator-framework</artifactId>
    

    就可以

  2. chickenlj commented on Feb 18, 2019

    @chickenlj
    Contributor

    I think it's a side effect of defaulting the Registry (only if it's zookeeper) as the Config Center.

    I guess you are using zookeeper registry and zkclient, right?

  3. added this to the 2.7.1 milestone on Feb 18, 2019
  4. GrayWind33 commented on Feb 19, 2019

    @GrayWind33
    ContributorAuthor

    I think it's a side effect of defaulting the Registry (only if it's zookeeper) as the Config Center.

    I guess you are using zookeeper registry and zkclient, right?

    yes, I use zk as my registry

  5. zhanglypl commented on Mar 5, 2019

    @zhanglypl

    用curator-client 就可以解决

  6. beiwei30 commented on Mar 7, 2019

    @beiwei30
    Member

    we need to refresh README when we release 2.7.1

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions