Open dharrigan opened 10 months ago
Encountering this issue, too. Upgrading to ring-jetty-adapter 1.11.0 causes the exception
Syntax error (NoSuchFieldException) compiling . at (cognitect/http_client.clj:41:9) getProperties
A revert back to ring-jetty-adapter 1.10.0 resolves it. The motivation for the ring-jetty-upgrade was a detection from one of our security scanners for a CVE (which doesn't impact us; we're just aiming to resolve the alert).
Thanks, and sorry about this frustration. I'm probably stating what you already realize, but
clojure -X:deps tree
can be used to visualize the dependencies.Solving the problem of aws-api's transitive dependency on jetty 9.4.x is our top priority for our next release.
Any idea when the transitive dependency will be solved? Currently we cannot use aws-api
as we transitioned to https://github.com/sunng87/ring-jetty9-adapter which uses Jetty 12.0.x and we cannot downgrade or switch back to ring adapter as we rely on functionality from Jetty 12.0
I saw there was an effort to move the HTTP client to the JDK version
As an aside, Is there any example code of how to use the :http-client
prop so we don't rely on the default-http-client
?. I see it needs to implement the HttpClient
protocol
(defprotocol HttpClient
(-submit [_ request channel]
"Submit an http request, channel will be filled with response. Returns ch.
Request map:
:scheme :http or :https
:server-name string
:server-port integer
:uri string
:query-string string, optional
:request-method :get/:post/:put/:head/:delete
:headers map from downcased string to string
:body ByteBuffer, optional
:timeout-msec opt, total request send/receive timeout
:meta opt, data to be added to the response map
content-type must be specified in the headers map
content-length is derived from the ByteBuffer passed to body
Response map:
:status integer HTTP status code
:body ByteBuffer, optional
:headers map from downcased string to string
:meta opt, data from the request
On error, response map is per cognitect.anomalies.
Alpha. This will absolutely change.")
(-stop [_] "Stops the client, releasing resources"))
I have a fork of com.cognitect/http-client
that uses Jetty 11: https://github.com/tobias/cognitect-http-client. I'm currently using it in production for clojars.org without issue. Folks are free to use that, and @scottbale you are welcome to use the changes there if you do decide to upgrade the official client to Jetty 11.
+1 on this, we can't use aws-api
with https://github.com/hyperfiddle/electric since it requires Jetty 11 for websocket support
@bhurlow Does my fork work for you?
Solving the problem of aws-api's transitive dependency on jetty 9.4.x is our top priority for our next release.
Hello, it's been about 7 months since this comment. Is there any solution for this issue yet?
Hello, it's been about 7 months since this comment. Is there any solution for this issue yet?
(In the mean time, for us Tobias' fork worked fine on Jetty 11. Jetty 11 reached end of community support as of January 2024. Per https://github.com/cognitect-labs/aws-api/issues/181#issuecomment-2293312773, we forked Tobias' Jetty 11 fork and made it work with Jetty 12.)
We have just released a beta release which introduces a Java-native http client. With this release, Jetty is no longer by default a transitive dependency.
@dharrigan if time permits, could you please verify whether this release solves your issue? Thanks.
(I will leave this issue open for the time being until we verify.)
Thank you for your interest in helping to improve Cognitect's aws-api!
Dependencies
Clojure CLI version 1.11.1.1435
Description with failing test case
As ring is now available as a
1.11.0
release (along with the dependencyring/ring-jetty-apapter 1.11.0
), when upgrading deps and then starting the http-client (as a dependency injected resource), the following occurs:Reverting back to
ring/ring-jetty-adapter {:mvn/version "1.10.0"}
fixes the problem.Thank you.
-=david=-