tyrus

Receiving pings with Java EE Websocket API

随声附和 提交于 2019-12-04 09:43:49
I'm currently working with the Tyrus reference implementation of the Java Websocket API. I've successfully created a server endpoint that receives binary messages, text messages, and pong messages, but I'm stuck trying to get it to receive ping messages. I've searched through much of the Tyrus source code and read the Jave EE Websocket tutorial but neither demonstrate functionality for receiving pings (only for sending them). Does anyone know if this is something not possible with the current API? If not, could you point me in the right direction for receiving ping messages? You cannot process

minimal java8 nio secure websocket client (wss)

情到浓时终转凉″ 提交于 2019-12-03 17:49:48
问题 I've spent quite some time to find simple java websocket client that could work with wss and wont be a mess... I've tried https://github.com/TooTallNate/Java-WebSocket added dependency as he descirbes, copied the SSLClientExample.java to test it with websocket.org echo server, but got compile error at line 84 no such method setSocket()... (stuck here) I tried tyrus (seems this is a big library developed directly by oracle) but it seems i need to have some appserver running (websocket

minimal java8 nio secure websocket client (wss)

雨燕双飞 提交于 2019-12-03 06:30:16
I've spent quite some time to find simple java websocket client that could work with wss and wont be a mess... I've tried https://github.com/TooTallNate/Java-WebSocket added dependency as he descirbes, copied the SSLClientExample.java to test it with websocket.org echo server, but got compile error at line 84 no such method setSocket()... (stuck here) I tried tyrus (seems this is a big library developed directly by oracle) but it seems i need to have some appserver running (websocket container) to be able to use it... I wonder whats so difficult about websockets that one needs to have netty or

Java EE 7: How-to inject an EJB into a WebSocket ServerEndpoint?

孤人 提交于 2019-11-28 18:47:43
To sum up my failing project: My @ServerEndpoint class is packaged in a WAR together with the beans.xml file. My WAR in turn is packaged in a EAR and this EAR file is what gets deployed to a GlassFish 4 server that internally use Tyrus. Should it be possible? The WebSocket specification says: Websocket endpoints running in the Java EE platform must have full dependency injection support as described in the CDI specification. Websocket implementations part of the Java EE platform are required to support field, method, and constructor injection using the javax.inject. Inject annotation into all

Websocket SSL handshake failure

爷,独闯天下 提交于 2019-11-28 13:36:00
I have spring-boot Tomcat server for secure websocket connections. The server accepts Android 4.4, iOS, Firefox, and Chrome clients without failure with an authority-signed certificate. Android 5.0, however, fails the SSL handshake. Caused by: javax.net.ssl.SSLHandshakeException: Handshake failed at com.android.org.conscrypt.OpenSSLEngineImpl.unwrap(OpenSSLEngineImpl.java:436) at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:1006) at org.glassfish.grizzly.ssl.SSLConnectionContext.unwrap(SSLConnectionContext.java:172) at org.glassfish.grizzly.ssl.SSLUtils.handshakeUnwrap(SSLUtils.java:263) at

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

Deadly 提交于 2019-11-28 02:17:52
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 class AbstractEndpoint{ // irrelevant onOpen, onOpen handling method 117 protected void sendMessage(Session

Java EE 7: How-to inject an EJB into a WebSocket ServerEndpoint?

末鹿安然 提交于 2019-11-27 11:39:44
问题 To sum up my failing project: My @ServerEndpoint class is packaged in a WAR together with the beans.xml file. My WAR in turn is packaged in a EAR and this EAR file is what gets deployed to a GlassFish 4 server that internally use Tyrus. Should it be possible? The WebSocket specification says: Websocket endpoints running in the Java EE platform must have full dependency injection support as described in the CDI specification. Websocket implementations part of the Java EE platform are required

Websocket SSL handshake failure

南楼画角 提交于 2019-11-27 07:44:25
问题 I have spring-boot Tomcat server for secure websocket connections. The server accepts Android 4.4, iOS, Firefox, and Chrome clients without failure with an authority-signed certificate. Android 5.0, however, fails the SSL handshake. Caused by: javax.net.ssl.SSLHandshakeException: Handshake failed at com.android.org.conscrypt.OpenSSLEngineImpl.unwrap(OpenSSLEngineImpl.java:436) at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:1006) at org.glassfish.grizzly.ssl.SSLConnectionContext.unwrap