You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using requests.patch(), the following error is thrown running on JRE 17
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 @4f9e5d6a
--
Exception: | java.lang.reflect.InaccessibleObjectException
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
requests.Requester$$anon$1.$anonfun$readBytesThrough$2(Requester.scala:214)
requests.Requester$$anon$1.$anonfun$readBytesThrough$2$adapted(Requester.scala:213)
scala.Option.foreach(Option.scala:437)
requests.Requester$$anon$1.readBytesThrough(Requester.scala:213)
geny.Readable.writeBytesTo(Writable.scala:93)
geny.Readable.writeBytesTo$(Writable.scala:93)
requests.Requester$$anon$1.writeBytesTo(Requester.scala:164)
requests.Requester.apply(Requester.scala:113)
// HttpURLConnection enforces a list of official http METHODs, but not everyone abides by the spec
trying to access the underlying implementation of HttpURLConnection, which in this case is sun.net.www.protocol.https.DelegateHttpsURLConnection. The sun.net classes have been not exported for external use since Java 9.
When using requests.patch(), the following error is thrown running on JRE 17
This is due to the workaround here
requests-scala/requests/src/requests/Requester.scala
Line 209 in ac506a5
trying to access the underlying implementation of HttpURLConnection, which in this case is sun.net.www.protocol.https.DelegateHttpsURLConnection. The sun.net classes have been not exported for external use since Java 9.
The correct approach seems to be to switch to the HttpClient API as it does not restrict HTTP methods https://bugs.openjdk.org/browse/JDK-7016595
The text was updated successfully, but these errors were encountered: