Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JettyWebSocketServerContainer can not implement WebSocketPolicy because it is not an interface #495

Closed
jwr opened this issue Jan 29, 2024 · 4 comments

Comments

@jwr
Copy link

jwr commented Jan 29, 2024

I tried switching my application from ring 1.10.0 to 1.11.0 and I'm getting this error:

#error {                                                                                                               
 :cause class org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer can not implement org.eclipse.jetty.websocket.api.WebSocketPolicy, because it is not an interface (org.eclipse.jetty.websocket.api.WebSocketPolicy is in unnamed module of loader 'app')                                                                                              
 :via                                                   
 [{:type clojure.lang.Compiler$CompilerException                                                                       
   :message Syntax error macroexpanding at (ring/adapter/jetty.clj:1:1).
   :data #:clojure.error{:phase :execution, :line 1, :column 1, :source ring/adapter/jetty.clj}
   :at [clojure.lang.Compiler load Compiler.java 7665]} 
  {:type java.lang.IncompatibleClassChangeError                                                                        
   :message class org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer can not implement org.eclipse.jetty.websocket.api.WebSocketPolicy, because it is not an interface (org.eclipse.jetty.websocket.api.WebSocketPolicy is in un
named module of loader 'app')                                                                                          
   :at [java.lang.ClassLoader defineClass1 ClassLoader.java -2]}]

Not sure what is going on there.

I am using OpenJDK Runtime Environment Temurin-17.0.4.1+1 (build 17.0.4.1+1) on MacOS, in case that helps.

@weavejester
Copy link
Member

It looks like you have a dependency conflict. You'll want to check your app's dependency tree and see if any dependencies override Ring's Jetty dependencies with an incompatible version.

@jwr
Copy link
Author

jwr commented Jan 30, 2024

Indeed — it seems that com.bhauman/figwheel-main and com.cognitect.aws/api (through com.cognitect/http-client) rely on various jetty 9.4.36 variants. Not sure what the right move here is: force the newer version assuming other packages will not break, or stick with ring 1.10.0 for now.

@weavejester
Copy link
Member

There's an open issue on the Cognitect AWS-API that has some suggestions on how to deal with this problem: cognitect-labs/aws-api#181

@jwr
Copy link
Author

jwr commented Jan 30, 2024

Thanks! I think I'll just stay with ring 1.10.0 for now until things hopefully get resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants