3

I am trying our amazon's SWF flow framework, but I am getting the below error and the project does not compile. I am using maven for my dependency management and I'm running my code from Intellij.

[INFO] -------------------------------------------------------------
[ERROR] /home/meow/Arena/github/ProjectX/AWS/target/generated-sources/annotations/aws/swf/B_FlowFramework/B_WithAWSFlow/EditImageActivityClient.java:[24,18] <identifier> expected
[ERROR] /home/meow/Arena/github/ProjectX/AWS/target/generated-sources/annotations/aws/swf/B_FlowFramework/B_WithAWSFlow/EditImageActivityClient.java:[24,19] = expected
[ERROR] /home/meow/Arena/github/ProjectX/AWS/target/generated-sources/annotations/aws/swf/B_FlowFramework/B_WithAWSFlow/EditImageActivityClient.java:[24,25] illegal start of type
[ERROR] /home/meow/Arena/github/ProjectX/AWS/target/generated-sources/annotations/aws/swf/B_FlowFramework/B_WithAWSFlow/EditImageActivityClient.java:[29,18] <identifier> expected
[ERROR] /home/meow/Arena/github/ProjectX/AWS/target/generated-sources/annotations/aws/swf/B_FlowFramework/B_WithAWSFlow/EditImageActivityClient.java:[29,19] = expected

From Intellij, I've already confirmed if annotation processing is enabled from Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors -> Enable Annotation Processing

The codebase is on GitHub and its entry point is at https://github.com/vikkyhacks/ProjectX/blob/master/AWS/src/main/java/aws/swf/B_FlowFramework/B_WithAWSFlow/WorkflowStarter.java

Also adding pom.xml for easy reference,

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>vikkyhacks.projectX.aws</groupId>
    <artifactId>AWS</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <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>
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-dynamodb</artifactId>
            <version>1.11.635</version>
        </dependency>
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-iam</artifactId>
            <version>1.11.635</version>
        </dependency>
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-sqs</artifactId>
            <version>1.11.635</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.10</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <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>

</project>
vikkyhacks
  • 3,190
  • 9
  • 32
  • 47
  • How exactly is this question related to AspectJ? Why the tag? – kriegaex Sep 22 '19 at 14:26
  • the swf flow framework uses it and some of its old versions require it to be added it to the pom.xml, anyway I'll remove it. – vikkyhacks Sep 22 '19 at 20:46
  • Consider using Cadence Workflow (https://cadenceworkflow.io/) which is an open source version of SWF which doesn't need code generation and AspectJ dependency. – Maxim Fateev Sep 23 '19 at 23:26
  • @MaximFateev We are using this at work and I wanted to understand how amazon swf flow framework works, changing the framework is not an option for me. – vikkyhacks Sep 25 '19 at 15:04
  • Let me talk to your team and I can convince them to change it :) – Maxim Fateev Sep 25 '19 at 18:42

1 Answers1

0

It might be because you are using AWS SDK v1.11 and JDK 1.8. Did you try to upgrade AWS SDK to 2.0, or downgrade JDK to 1.6?

Check official documentation:

From SDK 1.1: https://github.com/aws/aws-sdk-java/blob/master/README.md

To run the SDK you will need Java 1.6+. For more information about the requirements and optimum settings for the SDK, please see the Installing a Java Development Environment section of the developer guide.

From SDK 2.0: https://github.com/aws/aws-sdk-java-v2/blob/master/README.md

To run the SDK you will need Java 1.8+. For more information about the requirements and optimum settings for the SDK, please see the Installing a Java Development Environment section of the developer guide.

Also, AWS recommends the BOM method for specifying/including individual modules:

Specifying Individual SDK Modules (Recommended) To select individual SDK modules, use the AWS SDK for Java bill of materials (BOM) for Maven. This ensures that the modules you specify use the same version of the SDK, and that they're compatible with each other.

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>bom</artifactId>
      <version>2.X.X</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

And an example for Kinesis and DynamoDB:

<dependencies>
  <dependency>
    <groupId>software.amazon.awssdk</groupId>
    <artifactId>kinesis</artifactId>
  </dependency>
  <dependency>
    <groupId>software.amazon.awssdk</groupId>
    <artifactId>dynamodb</artifactId>
  </dependency>
</dependencies>

Note: for SWF, try artifactId as swf. Full list: https://search.maven.org/search?q=g:software.amazon.awssdk

Fabio Manzano
  • 2,847
  • 1
  • 11
  • 23
  • can you show some example of swf dependency instead of dynamodb ? – vikkyhacks Sep 26 '19 at 17:44
  • Try artifact id "swf"(https://search.maven.org/artifact/software.amazon.awssdk/swf/2.8.0/jar) Complete list: https://search.maven.org/search?q=g:software.amazon.awssdk – Fabio Manzano Sep 26 '19 at 18:06
  • No luck with that link you gave, I am looking at https://mvnrepository.com/artifact/software.amazon.awssdk/aws-sdk-java/2.0.0-preview-1 but I don't see anything on SWF – vikkyhacks Sep 28 '19 at 12:12