2.8.0, 2.8.2, 2.9.1, 2.9.2 are all supported your POM needs a fix though, you need to match your scala-library with your kafka artifactID
so your Kafka artifactID = kafka_2.9.2 so your Scala version should be 2.9.2 /******************************************* Joe Stein Founder, Principal Consultant Big Data Open Source Security LLC http://www.stealth.ly Twitter: @allthingshadoop <http://www.twitter.com/allthingshadoop> ********************************************/ On Tue, Aug 27, 2013 at 12:41 PM, David Williams <dwilli...@truecar.com>wrote: > Thank you for the replies. Is there a minor version in specific you > recommend using? > > I have tried 2.8.[012] and receive a similar runtime exception: > > Caused by: java.lang.NoClassDefFoundError: scala/Tuple2$mcJJ$sp > at kafka.consumer.ConsumerConfig.<init>(ConsumerConfig.scala:77) > at com.example.Config.createConsumerConfig(Config.java:40) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:5 > 7) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp > l.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at > org.springframework.beans.factory.support.SimpleInstantiationStrategy.insta > ntiate(SimpleInstantiationStrategy.java:160) > > > > > > Just in case its useful here are my fill list of dependencies for my > starter project: > > > <dependencies> > <dependency> > <groupId>org.springframework</groupId> > <artifactId>spring-core</artifactId> > <version>3.2.4.RELEASE</version> > </dependency> > <dependency> > <groupId>org.springframework</groupId> > <artifactId>spring-context</artifactId> > <version>3.2.4.RELEASE</version> > </dependency> > <dependency> > <groupId>org.apache.kafka</groupId> > <artifactId>kafka_2.9.2</artifactId> > <version>0.8.0-beta1</version> > </dependency> > <dependency> > <groupId>javax.inject</groupId> > <artifactId>javax.inject</artifactId> > <version>1</version> > </dependency> > <dependency> > <groupId>org.scala-lang</groupId> > <artifactId>scala-library</artifactId> > <version>2.8.0</version> > </dependency> > </dependencies> > > > > > -- > > > > > > > On 8/26/13 9:33 PM, "Joe Stein" <crypt...@gmail.com> wrote: > > >Scala 2.10 support is slated for 0.8.1 release after a 0.8.0 release. > >Here is the patch you can apply if you need > >https://issues.apache.org/jira/browse/KAFKA-717 > > > > > >/******************************************* > > Joe Stein > > Founder, Principal Consultant > > Big Data Open Source Security LLC > > http://www.stealth.ly > > Twitter: @allthingshadoop > >********************************************/ > > > > > >On Aug 27, 2013, at 12:16 AM, David Williams <dwilli...@truecar.com> > >wrote: > > > >> > >> Hi Jay, > >> > >> To which jars are you referring? Does scala have a Maven coodinate? As > >> it stands I am compiling with. > >> > >> > >> <dependency> > >> <groupId>org.scala-lang</groupId> > >> <artifactId>scala-library</artifactId> > >> <version>2.10.2</version> > >> </dependency> > >> <dependency> > >> <groupId>org.scala-lang</groupId> > >> <artifactId>scala-reflect</artifactId> > >> <version>2.10.2</version> > >> </dependency> > >> > >> > >> > >> > >> -- > >> > >> > >> > >> > >> > >> > >> On 8/26/13 8:35 PM, "Jay Kreps" <jay.kr...@gmail.com> wrote: > >> > >>> Nothing complex here, you just don't have the the scala library on your > >>> classpath. It works just like any jar--if there is a dependency on > >>>classes > >>> in the jar it needs to be on the classpath. > >>> > >>> > >>> On Mon, Aug 26, 2013 at 7:10 PM, David Williams > >>> <dwilli...@truecar.com>wrote: > >>> > >>>> Hi all, > >>>> > >>>> First let me say I have detailed the description of the issue I have > >>>>in > >>>> an > >>>> Stack Overflow Ticket here: > >>>> > >>>> > >>>> > >>>> > >>>> > http://stackoverflow.com/questions/18455480/kafka-quickstart-java-lang- > >>>>no > >>>> classdeffounderror-scala-scalaobject > >>>> > >>>> I am trying to build a small prototype for a project in which I want > >>>>to > >>>> use Kafka. I am following this example: > >>>> > >>>> > >>>> > https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Exampl > >>>>e > >>>> > >>>> > >>>> However, when I compile and run the code I get this runtime exception. > >>>> What should I do to get a working prototype / example??? > >>>> > >>>> > >>>> Exception in thread "main" java.lang.reflect.InvocationTargetException > >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > >>>> at > >>>> > >>>> > >>>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja > >>>>va > >>>> :57) > >>>> at > >>>> > >>>> > >>>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso > >>>>rI > >>>> mpl.java:43) > >>>> at java.lang.reflect.Method.invoke(Method.java:606) > >>>> at com.simontuffs.onejar.Boot.run(Boot.java:340) > >>>> at com.simontuffs.onejar.Boot.main(Boot.java:166) > >>>> Caused by: java.lang.NoClassDefFoundError: scala/ScalaObject > >>>> at java.lang.ClassLoader.defineClass1(Native Method) > >>>> at java.lang.ClassLoader.defineClass(ClassLoader.java:792) > >>>> at > >>>> > >>>> > >>>>com.simontuffs.onejar.JarClassLoader.defineClass(JarClassLoader.java:80 > >>>>3) > >>>> at > >>>> > >>>>com.simontuffs.onejar.JarClassLoader.findClass(JarClassLoader.java:710) > >>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:424) > >>>> at > >>>> > >>>>com.simontuffs.onejar.JarClassLoader.loadClass(JarClassLoader.java:630) > >>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > >>>> at java.lang.ClassLoader.defineClass1(Native Method) > >>>> at java.lang.ClassLoader.defineClass(ClassLoader.java:792) > >>>> at > >>>> > >>>> > >>>>com.simontuffs.onejar.JarClassLoader.defineClass(JarClassLoader.java:80 > >>>>3) > >>>> at > >>>> > >>>>com.simontuffs.onejar.JarClassLoader.findClass(JarClassLoader.java:710) > >>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:424) > >>>> at > >>>> > >>>>com.simontuffs.onejar.JarClassLoader.loadClass(JarClassLoader.java:630) > >>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > >>>> at java.lang.Class.getDeclaredMethods0(Native Method) > >>>> at java.lang.Class.privateGetDeclaredMethods(Class.java:2521) > >>>> at java.lang.Class.getDeclaredMethods(Class.java:1845) > >>>> at > >>>> > >>>> > >>>>org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMe > >>>>th > >>>> ods(StandardAnnotationMetadata.java:180) > >>>> at > >>>> > >>>> > >>>>org.springframework.context.annotation.ConfigurationClassParser.doProce > >>>>ss > >>>> ConfigurationClass(ConfigurationClassParser.java:222) > >>>> at > >>>> > >>>> > >>>>org.springframework.context.annotation.ConfigurationClassParser.process > >>>>Co > >>>> nfigurationClass(ConfigurationClassParser.java:165) > >>>> at > >>>> > >>>> > >>>>org.springframework.context.annotation.ConfigurationClassParser.parse(C > >>>>on > >>>> figurationClassParser.java:140) > >>>> at > >>>> > >>>> > >>>>org.springframework.context.annotation.ConfigurationClassPostProcessor. > >>>>pr > >>>> ocessConfigBeanDefinitions(ConfigurationClassPostProcessor.java:282) > >>>> at > >>>> > >>>> > >>>>org.springframework.context.annotation.ConfigurationClassPostProcessor. > >>>>po > >>>> > >>>>stProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:22 > >>>>3) > >>>> at > >>>> > >>>> > >>>>org.springframework.context.support.AbstractApplicationContext.invokeBe > >>>>an > >>>> FactoryPostProcessors(AbstractApplicationContext.java:630) > >>>> at > >>>> > >>>> > >>>>org.springframework.context.support.AbstractApplicationContext.refresh( > >>>>Ab > >>>> stractApplicationContext.java:461) > >>>> at > >>>> > >>>> > >>>>org.springframework.context.annotation.AnnotationConfigApplicationConte > >>>>xt > >>>> .<init>(AnnotationConfigApplicationContext.java:73) > >>>> ... 6 more > >>>> Caused by: java.lang.ClassNotFoundException: scala.ScalaObject > >>>> at > >>>> > >>>>com.simontuffs.onejar.JarClassLoader.findClass(JarClassLoader.java:713) > >>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:424) > >>>> at > >>>> > >>>>com.simontuffs.onejar.JarClassLoader.loadClass(JarClassLoader.java:630) > >>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > >>>> ... 34 more > >>>> > >>>> -- > >>>> > >>>> > >> > >