java.lang.NoClassDefFoundError: org/apache/curator/RetryPolicy解决方法

Posted 太白的技术博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java.lang.NoClassDefFoundError: org/apache/curator/RetryPolicy解决方法相关的知识,希望对你有一定的参考价值。

今天集成es-job到公司的框架时,启动时出现上述错误
java.lang.NoClassDefFoundError: org/apache/curator/RetryPolicy 
at  storm.kafka.KafkaSpout.open(KafkaSpout.java:68) 
at backtype.storm.daemon.executor$fn__4949$fn__4964.invoke(executor.clj:542)
at backtype.storm.util$async_loop$fn__452.invoke(util.clj:463) 
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:745) 
Caused by: java.lang.ClassNotFoundException: org.apache.curator.RetryPolicy 
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) 
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425) 
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 5 more

 在此之前将冲突不兼容的curator从2.11.1改成了2.10,后来是2.10.0,不存在2.10这个版本。

Curator 存在版本兼容问题。

Curator 2.x.x-兼容两个zk 3.4.x zk 3.5.x,

Curator 3.x.x-兼容兼容zk 3.5。

Versions
The are currently two released versions of Curator, 2.x.x and 3.x.x:

Curator 2.x.x - compatible with both ZooKeeper 3.4.x and ZooKeeper 3.5.x
Curator 3.x.x - compatible only with ZooKeeper 3.5.x and includes support for new features such as dynamic reconfiguration, etc.

 

以上是关于java.lang.NoClassDefFoundError: org/apache/curator/RetryPolicy解决方法的主要内容,如果未能解决你的问题,请参考以下文章