1

I'm seeing - java.lang.NoClassDefFoundError: org/apache/kafka/test/TestCondition in my integration tests. I think this is something related to way the repository import the kafka related packages. I'm adding pom dependencies with scope and classifiers used.

Could you please help fixing this?

     <kafka-clients.version>0.10.2.1</kafka-clients.version>

     <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-streams</artifactId>
        <version>${kafka-clients.version}</version>
        <classifier>test</classifier>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-streams</artifactId>
        <version>${kafka-clients.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-clients</artifactId>
        <version>${kafka-clients.version}</version>
    </dependency>
unknown_boundaries
  • 1,482
  • 3
  • 25
  • 47

1 Answers1

2
    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-clients</artifactId>
        <version>${kafka-clients.version}</version>
        <classifier>test</classifier>
    </dependency>

TestCondition is in kafka-clients-version-test.jar So add classifer test to 'kafka-clients' artifactId

bistros
  • 1,139
  • 1
  • 9
  • 23
  • That is resolved but now I see another exception. Seems unrelated though - org.apache.kafka.common.KafkaException: Could not instantiate class www.avro.support.AvroSerde Does it have a public no-argument constructor? – unknown_boundaries Jun 15 '20 at 05:13
  • @Prakhar www.avro.support.AvroSerde isn't Apache Kafka Class. I need more code and stacktrace – bistros Jun 15 '20 at 05:27