0

I'm using Kafka as data source for Flink job. When I'm deploying job to flink cluster job manager I'm receiving an error ClassNotFoundException: Caused by: java.lang.ClassNotFoundException: org.apache.flink.connector.kafka.source.KafkaSource

Below is my pom.xml dependancies

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-connector-kafka_2.12</artifactId>
            <version>1.13.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-avro</artifactId>
            <version>1.13.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-clients_2.12</artifactId>
            <version>1.13.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
    </dependencies>
1
  • 1
    Create an uber jar Commented Aug 28, 2021 at 12:10

2 Answers 2

4

Flink itself does not contain these extension JAR files (u can find jar file in flink/lib ), If you do not enter these jars into your project's JAR file(uber jar), or specify them when submitting the task (see the Flink documentation), flink runtime will not find these Jars.

Sign up to request clarification or add additional context in comments.

Comments

-1

Flink connector is not under the flink classpath by default, you need to add the kafka connector maven dependency into your project

1 Comment

Please provide additional details in your answer. As it's currently written, it's hard to understand your solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.