Hello Guys. I need help. I'm trying to setup simp...
# troubleshooting
p
Hello Guys. I need help. I'm trying to setup simple job with
MongoSource
based on this documentation: https://nightlies.apache.org/flink/flink-docs-release-1.19/docs/connectors/datastream/mongodb/ . I'm using maven for dependencies and I even started the project from recommended maven archetype. I've tried several versions and no matter what I choose I'm getting such error while running the job:
Copy code
Caused by: java.lang.NoSuchMethodError: 'void org.apache.flink.connector.base.source.reader.fetcher.SingleThreadFetcherManager.<init>(org.apache.flink.connector.base.source.reader.synchronization.FutureCompletingBlockingQueue, java.util.function.Supplier)'
	at org.apache.flink.connector.mongodb.source.reader.MongoSourceReader.<init>(MongoSourceReader.java:56)
	at org.apache.flink.connector.mongodb.source.MongoSource.createReader(MongoSource.java:145)
	at org.apache.flink.streaming.api.operators.SourceOperator.initReader(SourceOperator.java:346)
I've even found some sample code done by other dev and I was hoping to run the example with his dependencies but with no luck. I'm getting similar issue, which is totally weird for me. Could anyone have any idea how to fix this? Maybe any of you have real working setup with MongoSource to share?
a
Error suggests that you're using incompatible combination of Flink and Mongo connector. Which dependency version combinations have you tried?
are you trying to run Flink 2.0?
p
For example:
Copy code
<flink.version>1.17.1</flink.version>

        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-streaming-java</artifactId>
            <version>${flink.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-clients</artifactId>
            <version>${flink.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Add connector dependencies here. They must be in the default scope (compile). -->

        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-connector-base</artifactId>
            <version>${flink.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-connector-mongodb</artifactId>
            <version>1.0.1-1.17</version>
        </dependency>
But I'm running this on 2.0 server. Is is possible that this is the problem?
a
But I’m running this on 2.0 server. Is is possible that this is the problem?
yes, this is a problem since you’re using Flink 1.17 to build your application, you also need to run it on 1.17 server
🙌 1