java.lang.NoClassDefFoundError: org/apache/beam/sd

2019-08-31 02:22发布

问题:

Getting runtime error:

"java.lang.NoClassDefFoundError: org/apache/beam/sdk/runners/PipelineRunner"

even though I have below in my pom.xml

<dependency>
        <groupId>com.google.cloud.dataflow</groupId>
        <artifactId>google-cloud-dataflow-java-sdk-all</artifactId>
        <version>[2.1.0, 2.99)</version>
    </dependency>

All compile time errors have been resolved after moving to 2.X, started getting runtime error.

mvn compile on this project also reports success. Just when I attempt to run the pipeline from eclipse get this error.

回答1:

I added below to my pom.xml and deleted any all run profiles in pom.xml and error was resolved.

<dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-runners-google-cloud-dataflow-java</artifactId>
      <version>[2.1.0, 2.99)</version>
    </dependency>