Hi,

I am trying to compile Beam 0.2.0 release, but got the following error.


[INFO] [ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.3:compile
(default-compile) on project basic: Compilation failure: Compilation
failure:
[INFO] [ERROR]
/homes/hny9/shenli/Project/incubator-beam/sdks/java/maven-archetypes/starter/target/test-classes/projects/basic/project/basic/src/main/java/it/pkg/StarterPipeline.
java:[60,7] method does not override or implement a method from a supertype
[INFO] [ERROR]
/homes/hny9/shenli/Project/incubator-beam/sdks/java/maven-archetypes/starter/target/test-classes/projects/basic/project/basic/src/main/java/it/pkg/StarterPipeline.
java:[54,7] method does not override or implement a method from a supertype

I looked at the code in StarterPipeline.java (as shown below). It is trying
to override the DoFn.processElement() method. In the 0.2.0 release,
processElement is still in DoFn rather than OldDoFn. I suspect it is
importing beam sdk 0.3.0. So, I clean the repo, and removed the beam fold
from ~/.m2. Still got the same error.

public class StarterPipeline {
  private static final Logger LOG = LoggerFactory.getLogger(StarterPipeline.
class);

  public static void main(String[] args) {
    Pipeline p = Pipeline.create(
        PipelineOptionsFactory.fromArgs(args).withValidation().create());

    p.apply(Create.of("Hello", "World"))
    .apply(ParDo.of(new DoFn<String, String>() {
      @Override
      public void processElement(ProcessContext c) {
        c.output(c.element().toUpperCase());
      }
    }))
    .apply(ParDo.of(new DoFn<String, Void>() {
      @Override
      public void processElement(ProcessContext c)  {
        LOG.info(c.element());
      }
    }));

    p.run();
  }
}


After the compilation, the 0.3.0 jar does exist in
~/.m2/repository/org/apache/beam/beam-sdks-java-core/0.3.0-incubating/. And
the pom.xml
in 
sdks/java/maven-archetypes/starter/target/test-classes/projects/basic/project/basic
is referencing the latest release in the repository.


   <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-core</artifactId>
      <version>[0-incubating, 1-incubating)</version>
    </dependency>


Can someone help with this?


Thanks,


Shen

Reply via email to