我正在尝试为Web套接字实现创建客户端。在执行setConnectTimeout时遇到上述错误。
import org.eclipse.jetty.websocket.client.WebSocketClient;
WebSocketClient client = new WebSocketClient();
client.setConnectTimeout(20);
有人可以让我知道为什么会出现此错误吗?
答案 0 :(得分:0)
我收到此消息是因为它缺少Maven中的http依赖项:
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
<version> 9.4.28.v20200408</version>
</dependency>