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.