Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dubbo 2.7.1-SNAPSHOT NoClassDefFoundError when use springboot #3426

Closed
2 tasks done
GrayWind33 opened this issue Feb 2, 2019 · 5 comments
Closed
2 tasks done

dubbo 2.7.1-SNAPSHOT NoClassDefFoundError when use springboot #3426

GrayWind33 opened this issue Feb 2, 2019 · 5 comments
Milestone

Comments

@GrayWind33
Copy link
Contributor

GrayWind33 commented Feb 2, 2019

  • 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>
@LiZhenNet
Copy link
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>

就可以

@chickenlj
Copy link
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?

@chickenlj chickenlj added this to the 2.7.1 milestone Feb 18, 2019
@GrayWind33
Copy link
Contributor Author

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

@zhanglypl
Copy link

用curator-client 就可以解决

@beiwei30
Copy link
Member

beiwei30 commented Mar 7, 2019

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants