Armin Wasicek created ZEPPELIN-3524: ---------------------------------------
Summary: com.amazonaws.util.json.JSONArray is deprecated Key: ZEPPELIN-3524 URL: https://issues.apache.org/jira/browse/ZEPPELIN-3524 Project: Zeppelin Issue Type: Bug Components: zeppelin-zengine Reporter: Armin Wasicek Currently, Zeppelin uses \{{<aws.sdk.s3.version>1.10.77</aws.sdk.s3.version>}} that imports a JSON library that Amazon deprecated in subsequent releases: Amazon moved to Jackson JSON parser: {noformat} Dropped usage of Json.org library in favor of Jackson.{noformat} [https://aws.amazon.com/releasenotes/aws-sdk-for-java-1-11-0/] Importing some other libraries in Zeppelin that use a higher version of the AWS SDK leads to a compile error (see below). Amazon recommends: {noformat} If a project has the combination of a version clash and a limited total project size (e.g., AWS Lambda limits package size to 50MB), the bundled dependency might not be the right solution. Instead, you can build your own version of the AWS SDK for Java from the open sourced code on GitHub.{noformat} [https://aws.amazon.com/blogs/developer/java-sdk-bundle/] It might not be convenient to manage an extra version of the SDK for Zeppelin. Concerned code is in org/apache/zeppelin/notebook/repo/zeppelinhub/websocket/ZeppelinhubClient.java, \{{runAllParagraph}}) *Short-term solution* Replace {code:java} import com.amazonaws.util.json.JSONObject; import com.amazonaws.util.json.JSONArray; import com.amazonaws.util.json.JSONException;{code} with {code:java} import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; {code} *Better solution:* Move to Jackson and bump up the Amazon AWS SDK version to 1.11.x Compile error: {noformat} [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project zeppelin-zengine: Compilation failure: Compilation failure: [ERROR] /Users/armin/git/zeppelin/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/zeppelinhub/websocket/ZeppelinhubClient.java:[47,31] cannot find symbol [ERROR] symbol: class JSONArray [ERROR] location: package com.amazonaws.util.json [ERROR] /Users/armin/git/zeppelin/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/zeppelinhub/websocket/ZeppelinhubClient.java:[48,31] cannot find symbol [ERROR] symbol: class JSONException [ERROR] location: package com.amazonaws.util.json [ERROR] /Users/armin/git/zeppelin/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/zeppelinhub/websocket/ZeppelinhubClient.java:[49,31] cannot find symbol [ERROR] symbol: class JSONObject [ERROR] location: package com.amazonaws.util.json{noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)