HTTP PATCH method fails while uploading a file to ADLS Gen2 in jdk 17

Ramya K 1 Reputation point
2022-10-18T19:50:30.707+00:00

We use ADLS Gen2 rest API for uploading and downloading files to ADLS Gen2. To upload a file, we have to invoke PATCH method.

Reference: https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update

We use jersey client to invoke Rest API. By default, Jersey uses HttpUrlConnector and HttpUrlConnector supports only HTTP 1.1 methods, HTTP patch is not supported.
When we try to upload a file in JDK 17, we get the below error :

10.19.2022 00:42:17:514 Thread-13 AzureDakeLakeClient.appendFileInChunks: Error occurred while appending the data datalakefs1/%2Fangular.js directory - Unable to make field private final sun.net.www.protocol.https.DelegateHttpsURLConnection sun.net.www.protocol.https.HttpsURLConnectionImpl.delegate accessible: module java.base does not "opens sun.net.www.protocol.https" to unnamed module @6e732b02
10.19.2022 00:42:17:520 Thread-13 Thread-13.UploadChunkThread.run - exception in upload: Append file operation failed for datalakefs1//angular.js
10.19.2022 00:42:17:520 EXCEPTION: java.lang.Exception
Message: Append file operation failed for datalakefs1//angular.js
StackTrace: java.lang.Exception: Append file operation failed for datalakefs1//angular.js
at com.proginet.sift.proxy.azure.AzureDataLakeClient.uploadChunk(AzureDataLakeClient.java:1371)
at com.proginet.sift.proxy.azure.AzureCfccClient$UploadChunkThread.run(AzureCfccClient.java:467)

Reference : https://github.com/eclipse-ee4j/jersey/issues/4825

Note: I tested with JDK 15. No issues found.

We tried with Apache Connector with jersey client, but there were issues with content length header.
Could you please suggest a solution for this issue in Java 17.
Also, please let us know if there any plans to replace HTTP PATCH method with PUT.

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,559 questions
Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,529 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 47,466 Reputation points Microsoft Employee Moderator
    2022-10-27T06:48:21.61+00:00

    @Ramya K Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused.

    For clients that do not yet support PATCH, you can use PUT with the “x-http-method-override: PATCH” header.

    If you have any additional questions or need further clarification, please let me know.

    ----------

    Please do not forget to 254566-accept-answer.png and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.