Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

How do you close the session? #5

Closed
totszwai opened this issue Dec 13, 2017 · 1 comment
Closed

How do you close the session? #5

totszwai opened this issue Dec 13, 2017 · 1 comment

Comments

@totszwai
Copy link

In the example provided, the line:
((LifeCycle) container).stop();

Cause the following Exception, what's the proper way to stop the websocketclient?

17:15:42 ERROR    java.lang.InterruptedException
	at java.lang.Object.wait(Native Method)
	at java.lang.Thread.join(Unknown Source)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.doStop(QueuedThreadPool.java:159)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:142)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:160)
	at org.eclipse.jetty.client.HttpClient.doStop(HttpClient.java:255)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:142)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:160)
	at org.eclipse.jetty.websocket.client.WebSocketClient.doStop(WebSocketClient.java:400)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:142)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:160)
	at org.eclipse.jetty.websocket.jsr356.ClientContainer.doStop(ClientContainer.java:280)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
@joakime
Copy link
Member

joakime commented Apr 8, 2021

That is the way to do it with Jetty.

Note that the javax.websocket Client container does not have a lifecycle.
jakartaee/websocket#212

Your specific issue is that you have a ThreadPool that is failing to stop with the client container (it's probably active)

@joakime joakime closed this as completed Apr 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants