0
votes

I have a beam pipeline which has mongodb as source but when I try to run it it throws an exception.

An exception occured while executing the Java class. null: InvocationTargetException: org.apache.beam.sdk.io.BoundedSource.getDefaultOutputCoder()Lorg/apache/beam/sdk/coders/Coder

This is the code snippet that i am running inside main function

PipelineOptions options = PipelineOptionsFactory.create();

    Pipeline p = Pipeline.create(options);

    p.apply(MongoDbIO.read()
            .withUri("mongodb://<IP address>:27017")
            .withDatabase("<dbname>")
            .withCollection("<collection_name>"));
    p.run().waitUntilFinish();
1

1 Answers

0
votes

This happened because of different versions of mongo-io plugin and beam plugin