Compiler error when aws-java-sdk in pom.xml was updated to 1.11.3
jingleyang opened this issue ยท 6 comments
I would like to compile amazon-kinesis-client-1.6.3 with latest aws-java-sdk, which is 1.11.3. However, several compile error messages are shown as follows. Could someone help to solve it? Thanks.
jingledeMacBook-Pro:amazon-kinesis-client-1.6.3 yjy$ mvn deploy
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.amazonaws:amazon-kinesis-client:jar:1.6.3
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ line 128, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Amazon Kinesis Client Library for Java 1.6.3
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ amazon-kinesis-client ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ amazon-kinesis-client ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 126 source files to /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/target/classes
[INFO] /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/java/com/amazonaws/services/kinesis/clientlibrary/proxies/KinesisProxy.java: /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/java/com/amazonaws/services/kinesis/clientlibrary/proxies/KinesisProxy.java uses or overrides a deprecated API.
[INFO] /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/java/com/amazonaws/services/kinesis/clientlibrary/proxies/KinesisProxy.java: Recompile with -Xlint:deprecation for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/java/com/amazonaws/services/kinesis/leases/impl/Lease.java:[20,31] cannot find symbol
symbol: class JSONObject
location: package com.amazonaws.util.json
[ERROR] /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/java/com/amazonaws/services/kinesis/leases/impl/Lease.java:[229,20] cannot find symbol
symbol: class JSONObject
location: class com.amazonaws.services.kinesis.leases.impl.Lease
[ERROR] /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/java/com/amazonaws/services/kinesis/clientlibrary/proxies/KinesisProxyFactory.java:[136,15] method setEndpoint in class com.amazonaws.AmazonWebServiceClient cannot be applied to given types;
required: java.lang.String
found: java.lang.String,java.lang.String,java.lang.String
reason: actual and formal argument lists differ in length
[ERROR] /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/java/com/amazonaws/services/kinesis/clientlibrary/proxies/KinesisProxy.java:[111,15] method setEndpoint in class com.amazonaws.AmazonWebServiceClient cannot be applied to given types;
required: java.lang.String
found: java.lang.String,java.lang.String,java.lang.String
reason: actual and formal argument lists differ in length
[INFO] 4 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.607 s
[INFO] Finished at: 2016-05-25T18:17:47+08:00
[INFO] Final Memory: 18M/311M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project amazon-kinesis-client: Compilation failure: Compilation failure:
[ERROR] /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/java/com/amazonaws/services/kinesis/leases/impl/Lease.java:[20,31] cannot find symbol
[ERROR] symbol: class JSONObject
[ERROR] location: package com.amazonaws.util.json
[ERROR] /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/java/com/amazonaws/services/kinesis/leases/impl/Lease.java:[229,20] cannot find symbol
[ERROR] symbol: class JSONObject
[ERROR] location: class com.amazonaws.services.kinesis.leases.impl.Lease
[ERROR] /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/java/com/amazonaws/services/kinesis/clientlibrary/proxies/KinesisProxyFactory.java:[136,15] method setEndpoint in class com.amazonaws.AmazonWebServiceClient cannot be applied to given types;
[ERROR] required: java.lang.String
[ERROR] found: java.lang.String,java.lang.String,java.lang.String
[ERROR] reason: actual and formal argument lists differ in length
[ERROR] /Users/yjy/code/github.com/aws/amazon-kinesis-client-1.6.3/src/main/java/com/amazonaws/services/kinesis/clientlibrary/proxies/KinesisProxy.java:[111,15] method setEndpoint in class com.amazonaws.AmazonWebServiceClient cannot be applied to given types;
[ERROR] required: java.lang.String
[ERROR] found: java.lang.String,java.lang.String,java.lang.String
[ERROR] reason: actual and formal argument lists differ in length
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Try changing your dependency to the amazon-kinesis-client in your project to something like the below, and then explicitly specify the aws sdk version you need:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>amazon-kinesis-client</artifactId>
<version>$myversion</version>
<exclusions>
<exclusion>
<artifactId>aws-java-sdk</artifactId>
<groupId>com.amazonaws</groupId>
</exclusion>
</exclusions>
</dependency>
Sorry if I misunderstood, but the 1.11.x versions of aws-java-sdk-core no longer has com.amazon.util.json.JSON*
. This is according to https://aws.amazon.com/releasenotes/Java/9979983567247718
Wouldn't the Lease class need to be updated?
Thanks for the comments.
I am learning the sample code of aws kinesis. Firstly, I set aws-java-sdk-1.11.3.jar as dependency of the sample code. However, It did not work when I run the sample code.
I think recompiling the amazon-kinesis-client-1.6.3 with latest aws-java-sdk may help to solve the issue. However, some compile error happened.
Finally, I found if I only use the dependencies of amazon-kinesis-client-1.6.3 instead of aws-java-sdk-1.11.3.jar, the sample code will work.
Cheers,
Jingle
I really wanted to use AWS SDK 1.11.x so went to the trouble of updating the amazon-kinesis-client to support it. Some minor code changes were required. Have a look at my pull request #75 if you are interested.
How is it that 1.11.X has been out for over a month and a tiny tweak has not been made to the KCL for a coordinated release? Weird.
The KCL has now been updated to the 1.11 release, and is being release in Maven right now.
Sorry for the delay.