2017-08-11 101 views
0

我有一個有mongodb作爲源的束流管道,但是當我嘗試運行它時,它會拋出一個異常。Apache Beam mongodb源碼

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

這是代碼片段,我很主要功能內運行

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

回答

0

發生這種情況,因爲不同版本蒙戈-io的插件和插件梁的