java.lang.NoClassDefFoundError: org/apache/curator/RetryPolicy
share_i 提问于:2017-07-24
0 0

console:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/curator/RetryPolicy
    at cn.com.utils.gaea.remoting.tcp.zookeeper.register.ZookeeperRegistery.<init>(ZookeeperRegistery.java:48)
    at cn.com.utils.gaea.remoting.tcp.zookeeper.CuratorManager.connect(CuratorManager.java:69)
    at cn.com.utils.util.SmsTpl.main(SmsTpl.java:14)
Caused by: java.lang.ClassNotFoundException: org.apache.curator.RetryPolicy
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 3 more
  • 所有回答
bluesky 回答于:2017-07-24
0 0

看下classpath是否有以下jar:

maven:

<dependency>
        <groupId>org.apache.curator</groupId>
        <artifactId>curator-framework</artifactId>
        <version>2.8.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.curator</groupId>
        <artifactId>curator-recipes</artifactId>
        <version>2.8.0</version>
    </dependency>
我来回答    java.lang.NoClassDefFoundError: org/apache/curator/RetryPolicy