You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Andras Katona (Jira)" <ji...@apache.org> on 2020/05/14 13:08:00 UTC

[jira] [Created] (KAFKA-9992) EmbeddedKafka not working with kafka_2.13

Andras Katona created KAFKA-9992:
------------------------------------

             Summary: EmbeddedKafka not working with kafka_2.13
                 Key: KAFKA-9992
                 URL: https://issues.apache.org/jira/browse/KAFKA-9992
             Project: Kafka
          Issue Type: Bug
          Components: packaging, streams
    Affects Versions: 2.4.1
            Reporter: Andras Katona


Kafka Streams artifact is depending on kafka_2.12 as of now, it is in the [kafka-streams-2.4.1.pom|https://repo1.maven.org/maven2/org/apache/kafka/kafka-streams/2.4.1/kafka-streams-2.4.1.pom]:
{code}
<dependency>
  <groupId>org.apache.kafka</groupId>
  <artifactId>kafka_2.12</artifactId>
  <version>2.4.1</version>
  <scope>test</scope>
</dependency>  
{code}
But it is not hardcoded, whatever scala version was used to compile this component before uploading, that will be present in the pom.

When I'm using these deps:
{code}
<dependency>
  <groupId>org.apache.kafka</groupId>
  <artifactId>kafka-streams</artifactId>
  <version>2.4.1</version>
  <classifier>test</classifier>
  <scope>test</scope>
</dependency>

<dependency>
  <groupId>org.apache.kafka</groupId>
  <artifactId>kafka_2.13</artifactId>
  <version>2.4.1</version>
  <classifier>test</classifier>
  <scope>test</scope>
</dependency>
{code}

My test fails with the following exception (deleteTopicAndWait is called in my @After method):
{noformat}
java.lang.NoSuchMethodError: scala.collection.JavaConverters.setAsJavaSetConverter(Lscala/collection/Set;)Lscala/collection/convert/Decorators$AsJava;
        at org.apache.kafka.streams.integration.utils.EmbeddedKafkaCluster$TopicsDeletedCondition.conditionMet(EmbeddedKafkaCluster.java:316)
        at org.apache.kafka.test.TestUtils.lambda$waitForCondition$4(TestUtils.java:370)
        at org.apache.kafka.test.TestUtils.retryOnExceptionWithTimeout(TestUtils.java:417)
        at org.apache.kafka.test.TestUtils.retryOnExceptionWithTimeout(TestUtils.java:385)
        at org.apache.kafka.test.TestUtils.waitForCondition(TestUtils.java:368)
        at org.apache.kafka.test.TestUtils.waitForCondition(TestUtils.java:356)
        at org.apache.kafka.streams.integration.utils.EmbeddedKafkaCluster.deleteTopicsAndWait(EmbeddedKafkaCluster.java:266)
        at org.apache.kafka.streams.integration.utils.EmbeddedKafkaCluster.deleteTopicAndWait(EmbeddedKafkaCluster.java:221)
{noformat}

I modified kafka build locally to separate artifacts based on scala version just like it is done with kafka core, and I pulled in kafka-streams_2.13 from my local mvn repo and test was working again.

I was only trying with 2.4.1, but I'm assuming other versions are also affected, please add the proper versions and proper components too (in case it's not packaging).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)