tyrus

Bug in GlassFish 4 or Tyrus: Decoder#willDecode is called twice for each ByteBuffer?

…衆ロ難τιáo~ 提交于 2020-01-15 12:25:09
问题 I wrote the most simple application that uses WebSockets. My back end is GlassFish 4 build 89, my front end is a JavaFX 2.2 application client that uses Tyrus 1.0 RC3, the reference implementation of Java API for WebSockets. GlassFish uses Tyrus too although I've been to lazy to lookup exactly what version is included in GlassFish build 89. My test of the WebSocket API sent a java.util.Date back and forth, nothing more. Well, as a binary object should be added. So I wrote my own Decoder that

Using Java Websocket API Implementation without a Web-Server

百般思念 提交于 2020-01-04 05:50:57
问题 Is it possible to implement a custom WebSocket app in Java without having to run it on a Web-Server like GlassFish, Tomcat, Jetty etc? I intend to develop a very custom-tailored App and would like to implement my own way to manage threads, monitoring, load balance, messaging and stuff like that. (compared with e.g. Java TCP’s ServerSocket ) I know there are Tyrus containers such as Grizzly integration for standalone server and Servlet support and here is Jetty as well, but I am not sure if

Tyrus client cannot reconnect on server restart when client shared container is enabled

喜夏-厌秋 提交于 2019-12-24 11:27:31
问题 Here is the scenario: Websocket server is up Tyrus client shared container is enabled Tyrus client connects to server (everything is good) Websocket server restarts Tyrus client cannot connect to the server and throws the following exception even after the server is up: javax.websocket.DeploymentException: Connection failed If the client application is restarted it can connect to server again Note: This issue will not happen if Tyrus client shared container is disabled. stacktrace: javax

Incoming buffer size cannot be set to Tyrus client

有些话、适合烂在心里 提交于 2019-12-23 19:55:51
问题 I trying to transfer a file bigger than 4M via WebSocket. I'm using org.glassfish.tyrus:tyrus-server:1.13.1 and org.glassfish.tyrus:tyrus-container-grizzly-server:1.13.1 as dependencies. By default the incoming buffer size is about 4M (see: 8.4. Incoming buffer size). The documentation clearly says what needs to be done if I want to increase the size of the file but still can not change the incoming buffer size. Here is the essence of what I'm trying to do: CountDownLatch messageLatch = new

Connecting to a secured websocket

对着背影说爱祢 提交于 2019-12-18 11:12:37
问题 I'm trying to connect to a secured websocket using Jetty (or any other library). The issue is I get a "No trusted certificate found" error. I'm using a self-signed certificate generated with keytool. What could be done? import java.net.URI; import java.util.concurrent.Future; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketAdapter; import org

Tyrus websocket: IllegalStateException cannot set WriteListener for non-async request

淺唱寂寞╮ 提交于 2019-12-17 17:15:31
问题 I have a standard websocket endpoint based on Tyrus implementation which times to times triggers the java.lang.IllegalStateException: Cannot set WriteListener for non-async or non-upgrade request . We are running on Payara 4.1. My standard implementation @ServerEndpoint(value = "...", decoders=MessageDecoder.class, encoders=MessageEncoder.class) public class EndpointImpl extends AbstractEndpoint{ // onOpen, onClose, onMessage, onError methods } Where the abstract class is public abstract