Uploaded image for project: 'Zeppelin'
  1. Zeppelin
  2. ZEPPELIN-3524

com.amazonaws.util.json.JSONArray is deprecated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • zeppelin-zengine
    • None

    Description

      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:

      Dropped usage of Json.org library in favor of Jackson.

      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:

      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.

      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 

      import com.amazonaws.util.json.JSONObject;
      import com.amazonaws.util.json.JSONArray;
      import com.amazonaws.util.json.JSONException;

      with

      import org.json.JSONArray;
      import org.json.JSONException;
      import org.json.JSONObject;
      

       

      Better solution:

      Move to Jackson and bump up the Amazon AWS SDK version to 1.11.x

       

      Compile error:

      [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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hellospencer Armin Wasicek
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h