I can't import the WebSocketSettings package in the WebSocket example from the documentation

java
akka-http
websockets

(Storm Sergey) #1

Hello! I’m studying the akka and try it in code. I took this example (below), assembled the necessary packages (akka-http, akka-stream) using the graddle (or sbt). But my IDE does’t find the WebSocketSettings package on the line 23 (in GitHub) “import akka.http.javadsl.settings.WebSocketSettings;”. As a result, this code does’t work. There all the other packages is fine in this example. Please tell me what I’m doing wrong.

The code example is here:


from
https://doc.akka.io/docs/akka-http/current/server-side/websocket-support.html


(Tim Moore) #2

@Storm-Sergey can you post a link to your project?


(Storm Sergey) #3

I have no project. I just took this example and tried to use it to see how it works. I will add what I tried to run to show you.


(Storm Sergey) #4

If I try to build the project, I get this result. As if this package doesn’t exist.


(Arnout Engelen) #5

The reference to get is ambiguous error suggests you are using a version of Akka HTTP prior to 10.1.6. Akka HTTP should work with JDK 11 since 10.1.6. Could you update to the latest version (10.1.7) and show what errors you get then?


(Storm Sergey) #6

Oh. I’m stupid. I tried to build a project with gradle but there was a maven akka-http-seed-java.iml file inside. After deleting example is perfectly worked. Thank you very much