Fork me on GitHub
#pedestal
<
2022-12-18
>
Ben Hammond17:12:50

Hi I get a Jetty conflict between

com.cognitect.aws/api 0.8.612
and
io.pedestal/pedestal.jetty 0.5.10
They load different versions of Jetty which appear to play badly together
org.eclipse.jetty/jetty-http 9.4.48.v20220622
tries to call in to
org.eclipse.jetty/jetty-servlet 9.4.44.v20210927
and ends up with an UnsupportedOperationException. is this a known problem? and is there a standard fix? Stack trace looks like
java.lang.UnsupportedOperationException: Use .getMatched(String) instead
	at org.eclipse.jetty.http.pathmap.PathMappings.getMatch(PathMappings.java:259)
	at org.eclipse.jetty.servlet.ServletHandler.getMappedServlet(ServletHandler.java:572)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:468)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:512)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:555)
	at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:410)
	at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:164)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
	at java.base/java.lang.Thread.run(Thread.java:831)

Ben Hammond17:12:07

should I force io.pedestal/pedestal.jetty to use the new Jetty libraries?

souenzzo18:12:40

TLDR: yes. I think that you should simply use the newer ones.

hlship20:12:41

We have an alpha release of Pedestal 0.5.11 that's actually reasonably stable and updates the Jetty dependencies to 9.4.48.v20220622. I'm not at the office now so I'm having trouble tracking down where the dependency from aws/api to jetty comes from.

👍 1
hlship20:12:44

I may have a few minutes tomorrow to track this down. I'd check the dependency tree of aws/api.

Ben Hammond21:12:23

just to confirm - I can make my problem go away with this deps.edn configuration

io.pedestal/pedestal.jetty {:mvn/version "0.5.10"
                                    :exclusions [org.eclipse.jetty/jetty-alpn-server
                                                 org.eclipse.jetty/jetty-security
                                                 org.eclipse.jetty/jetty-server
                                                 org.eclipse.jetty/jetty-servlet
                                                 org.eclipse.jetty/jetty-util-ajax]}
        org.eclipse.jetty/jetty-alpn-server {:mvn/version "9.4.48.v20220622"}
        org.eclipse.jetty/jetty-server {:mvn/version "9.4.48.v20220622"}
        org.eclipse.jetty/jetty-servlet {:mvn/version "9.4.48.v20220622"}

hlship15:12:47

com.cognitect/http-client has a dep on jetty-client 9.4.48.v20220622 pedestal-jetty 0.5.11-alpha-1 also has a dep on 9.4.48.v20220622, so using the alpha will also fix this issue.