Kafka
  1. Kafka
  2. KAFKA-893

Unable to access kafka via Tomcat

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None
    • Environment:
      Apache Tomcat 7

      Description

      Iam using kafka_2.8.0-0.8-SNAPSHOT.jar and Apache Tomcat 7. Upon deploying, the Consumer example (provided at Kafka quickstart) in a Tomcat web app, I get the following error

      java.lang.VerifyError: class scala.Tuple2$mcLL$sp overrides final method _1.()Ljava/lang/Object;
      java.lang.ClassLoader.defineClass1(Native Method)
      java.lang.ClassLoader.defineClass(ClassLoader.java:791)
      java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2888)
      org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1172)
      org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
      org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
      kafka.consumer.ConsumerConfig.<init>(ConsumerConfig.scala:75)
      TestServlet.kafkaconsumer(TestServlet.java:44)
      TestServlet.doGet(TestServlet.java:20)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

      Please suggest what should be done to fix this error.

      Thanks in advance.
      Arathi

        Activity

        arathi m created issue -
        Hide
        Jay Kreps added a comment -

        I think this happens if you have the wrong version of scala on your classpath.

        Show
        Jay Kreps added a comment - I think this happens if you have the wrong version of scala on your classpath.
        Hide
        arathi m added a comment -

        Using Kafka dependency in my maven pom.xml
        <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka_2.10</artifactId>
        <version>0.8.0</version>
        </dependency>
        fixed the issue.

        Show
        arathi m added a comment - Using Kafka dependency in my maven pom.xml <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka_2.10</artifactId> <version>0.8.0</version> </dependency> fixed the issue.
        arathi m made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            arathi m
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development