title: Exception when consuming message from kafka
body: <p>In a Java project that is built by maven I'm trying to create a basic kafka (producer consumer) example.
  when running <a href="http://ransilberman.wordpress.com/" rel="nofollow">this code</a> I get this exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.UnsupportedClassVersionError: kafka/javaapi/producer/async/CallbackHandler : Unsupported major.minor version 51.0
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at kafka.javaapi.consumer.SimpleConsumer.fetch(SimpleConsumer.scala:43)
      at com.taptica.avrotest.KafkaLocalBroker.main(KafkaLocalBroker.java:101)
  </code></pre>
  
  <p>I also tried running similar code against a real kafka server (with zoo-keeper) and again - message was sent successfully to kafka (I could also verify it in my kafka server) but when tried to consume it got the same mentioned exception.</p>
  
  <p>Since I'm suspecting this is a matter of jar-versions mismatch here is my pom.xml:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.mycompany.rtb&lt;/groupId&gt;
      &lt;artifactId&gt;rtb-accumulation&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  
      &lt;properties&gt;
          &lt;avro.version&gt;1.7.5&lt;/avro.version&gt;
          &lt;org.springframework-version&gt;3.2.3.RELEASE&lt;/org.springframework-version&gt;
          &lt;jackson-version&gt;1.9.13&lt;/jackson-version&gt;
          &lt;kafka-version&gt;0.7.2-SNAPSHOT&lt;/kafka-version&gt;
          &lt;cglib-version&gt;2.2.2&lt;/cglib-version&gt;
          &lt;org.slf4j-version&gt;1.7.5&lt;/org.slf4j-version&gt;
      &lt;/properties&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;clojars.org&lt;/id&gt;
              &lt;url&gt;http://clojars.org/repo&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;dependencies&gt;
          &lt;!-- Spring --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;!-- Exclude Commons Logging in favor of SLF4j --&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;commons-logging&lt;/groupId&gt;
                      &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Kafka --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.clojars.jasonjckn&lt;/groupId&gt;
              &lt;artifactId&gt;kafka_2.9.2&lt;/artifactId&gt;
              &lt;version&gt;${kafka-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
              &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
              &lt;version&gt;2.9.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Avro --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.avro&lt;/groupId&gt;
              &lt;artifactId&gt;avro&lt;/artifactId&gt;
              &lt;version&gt;${avro.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.avro&lt;/groupId&gt;
              &lt;artifactId&gt;avro-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${avro.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.avro&lt;/groupId&gt;
              &lt;artifactId&gt;avro-compiler&lt;/artifactId&gt;
              &lt;version&gt;${avro.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.avro&lt;/groupId&gt;
              &lt;artifactId&gt;avro-ipc&lt;/artifactId&gt;
              &lt;version&gt;${avro.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.avro&lt;/groupId&gt;
              &lt;artifactId&gt;avro-mapred&lt;/artifactId&gt;
              &lt;version&gt;${avro.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Jackson --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
              &lt;version&gt;${jackson-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-core-asl&lt;/artifactId&gt;
              &lt;version&gt;${jackson-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Test --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.11&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- Logging --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.16&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;javax.mail&lt;/groupId&gt;
                      &lt;artifactId&gt;mail&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;javax.jms&lt;/groupId&gt;
                      &lt;artifactId&gt;jms&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jdmk&lt;/groupId&gt;
                      &lt;artifactId&gt;jmxtools&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jmx&lt;/groupId&gt;
                      &lt;artifactId&gt;jmxri&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- Misc --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
              &lt;artifactId&gt;guava&lt;/artifactId&gt;
              &lt;version&gt;r09&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;cglib&lt;/groupId&gt;
              &lt;artifactId&gt;cglib&lt;/artifactId&gt;
              &lt;version&gt;2.2.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.annotation&lt;/groupId&gt;
              &lt;artifactId&gt;jsr250-api&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Any ideas?</p>