Drop in a ZK dependency to deal with dependency issues I was having

With ZK 3.4.6 which was the default dependency we were pulling in before this
would happen:

   java.lang.NoClassDefFoundError: org/apache/zookeeper/Watcher
       at java.lang.Class.privateGetDeclaredMethods(Class.java:2693)
       at java.lang.Class.privateGetPublicMethods(Class.java:2894)
       at java.lang.Class.getMethods(Class.java:1607)
       at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
       at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
       at org.codehaus.groovy.classgen.asm.BytecodeHelper.box(BytecodeHelper.java:602)
       at offtopic.curator.CuratorClient.<init>(CuratorClient.groovy:14)
       at offtopic.curator.CuratorClientInitializationSpec.with a valid String(CuratorClientSpec.groovy:23)
   Caused by: java.lang.ClassNotFoundException: org.apache.zookeeper.Watcher
       at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
       at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
       ... 8 more
This commit is contained in:
R. Tyler Croy 2014-12-13 17:44:19 -08:00
parent ad0d9a0844
commit 6784611cff
1 changed files with 7 additions and 10 deletions

View File

@ -8,7 +8,7 @@ plugins {
apply plugin: 'groovy'
////////////////////////////////////////////////////////////////////////////////
version = '0.1.1'
version = '0.2.0'
group = 'offtopic'
description =' Offtopic is a simple web application built with Ratpack for inspecting and consuming events from Kafka.'
sourceCompatibility = '1.8'
@ -34,26 +34,23 @@ dependencies {
/* Needed for discovering brokers and all kinds of other things in
* Zookeeeper
*/
compile 'org.apache.curator:curator-framework:2.7.0+'
compile 'org.apache.curator:curator-framework:2.7.+'
compile 'org.apache.commons:commons-pool2:2.2+'
compile 'org.apache.kafka:kafka_2.10:0.8.1.1+'
compile 'org.slf4j:log4j-over-slf4j:1.7.6'
compile 'org.slf4j:slf4j-simple:1.7.6'
// Forcing us up to ZK 3.5 to prevent wacky classpath errors when mixing
// and matching dependencies
compile 'org.apache.zookeeper:zookeeper:3.5.+'
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
testCompile 'cglib:cglib-nodep:2.2.+'
}
////////////////////////////////////////////////////////////////////////////////
configurations {
compile.exclude module: 'log4j'
compile.exclude module: 'slf4j-log4j12'
}
test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
// vim: ft=groovy