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();