AWS SWF - activities client generation not working (Maven, IntelliJ)

301 views Asked by At

I'm working through the SWF tutorial right now and trying to get GreeterActivitiesClient in GreeterWorkFlowImpl. I'm getting "Cannot resolve symbol" error for the Client and the ClientImpl. Per the AWS materials, I thought these would be generated from the annotations in the Activities class, which I have. Any ideas?

Dependencies in my pom.xml, (taken from the materials):

<dependency>
  <groupId>log4j</groupId>
  <artifactId>log4j</artifactId>
  <version>1.2.17</version>
</dependency>
<dependency>
  <groupId>com.amazonaws</groupId>
  <artifactId>aws-swf-build-tools</artifactId>
  <version>1.0</version>
</dependency>

The SWF guide I'm using: https://docs.aws.amazon.com/amazonswf/latest/awsflowguide/setup.html#installing-maven

2

There are 2 answers

1
smac2020 On

That is old content. If you want to work with SWF and Java - look at V2 content here - including the POM dependencies.

https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/example_code/swf

Better yet, if you want to build workflows on the AWS Cloud, consider using AWS Step Functions.

There is a Java V2 AWS Step Functions tutorial here that walks you through how to create a workflow that interacts with other AWS Services.

Create AWS serverless workflows by using the AWS SDK for Java

0
wals On

I ran into the same issues running this tutorial with Maven. My pom.xml looked exactly the same.

I did two things to fix this issue:

  1. Go to settings > Build, Execution, Deployment > Compiler > Annotation Processors. Check Enable annotation processing

  2. Add maven-compiler-plugin to your pom.xml (latest at the time of writing). Such as:

    `

        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.5.1</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    

    `

Go ahead and run a build, the client classes should appear. I hope this helps.