jsr356

JUnit test with javax.websocket on embedded Jetty throws RejectedExecutionException: NonBlockingThread

ε祈祈猫儿з 提交于 2019-12-02 08:16:16
问题 I'm trying to write a test case which creates a socket and connects to an embedded jetty instance. I'm using Jetty: 9.2.0.RC0 javax.websocket-api & javax.websocket-client-api: 1.0 javax.websocket server & client impl: 9.1.5.v20140505 Starting the embedded jetty server with the websocket servlet seems to work fine. I took some code from this example. However this line ... container.connectToServer(SocketClient.class, uri); ... throws this exception java.io.IOException: java.util.concurrent

JUnit test with javax.websocket on embedded Jetty throws RejectedExecutionException: NonBlockingThread

雨燕双飞 提交于 2019-12-02 02:55:58
I'm trying to write a test case which creates a socket and connects to an embedded jetty instance. I'm using Jetty: 9.2.0.RC0 javax.websocket-api & javax.websocket-client-api: 1.0 javax.websocket server & client impl: 9.1.5.v20140505 Starting the embedded jetty server with the websocket servlet seems to work fine. I took some code from this example . However this line ... container.connectToServer(SocketClient.class, uri); ... throws this exception java.io.IOException: java.util.concurrent.RejectedExecutionException: org.eclipse.jetty.util.thread.NonBlockingThread@6f7476d at org.eclipse.jetty

Integrating JSR-356 WebSocket @ServerEndpoint with Spring 3 beans

孤人 提交于 2019-11-30 08:33:40
问题 I'm using Spring 3.2.5 without full new JSR-356 WebSockets support. I would like to have singleton-bean reference in my @ServerEndpoint WebSocket server, which is instantiated by servlet container itself, not in Spring context. What is the clean way to do it? My current solution: I made @Service singleton bean with instance in static field: @Service public class WebSocketSupportBean { private volatile static WebSocketSupportBean instance = null; public static WebSocketSupportBean getInstance(

JSR-356 WebSockets with Tomcat - How to limit connections within single IP address?

醉酒当歌 提交于 2019-11-30 06:40:52
问题 I made a JSR-356 @ServerEndpoint in which I want to limit alive connections from single IP address, to prevent simple DDOS attacks. Note that I'm search for Java solution (JSR-356, Tomcat or Servlet 3.0 specs). I have tried custom endpoint configurer but I don't have access to IP address even in HandshakeRequest object. How to limit JSR-356 connection count from single IP address without external software like iptables? 回答1: According to Tomcat developer @mark-thomas client IP is not exposed

Integrating JSR-356 WebSocket @ServerEndpoint with Spring 3 beans

北战南征 提交于 2019-11-29 06:56:00
I'm using Spring 3.2.5 without full new JSR-356 WebSockets support. I would like to have singleton-bean reference in my @ServerEndpoint WebSocket server, which is instantiated by servlet container itself, not in Spring context. What is the clean way to do it? My current solution: I made @Service singleton bean with instance in static field: @Service public class WebSocketSupportBean { private volatile static WebSocketSupportBean instance = null; public static WebSocketSupportBean getInstance() { return instance; } public WebSocketSupportBean() { instance = this; } and just getting it in

JSR-356 WebSockets with Tomcat - How to limit connections within single IP address?

限于喜欢 提交于 2019-11-28 20:56:41
I made a JSR-356 @ServerEndpoint in which I want to limit alive connections from single IP address, to prevent simple DDOS attacks. Note that I'm search for Java solution (JSR-356, Tomcat or Servlet 3.0 specs). I have tried custom endpoint configurer but I don't have access to IP address even in HandshakeRequest object. How to limit JSR-356 connection count from single IP address without external software like iptables? anttix According to Tomcat developer @mark-thomas client IP is not exposed via JSR-356 thus it is impossible to implement such a function with pure JSR-356 API-s. You have to

Websocket JSR-356 fail with Jetty 9.4.1

[亡魂溺海] 提交于 2019-11-28 13:10:38
My current web server is embedded Jetty 9.1.5. It works well with JSR-356 to create websocket. These days, I am trying to upgrade to Jetty 9.4.1. Everything works nicely except websocket. My code like below: Embedded Jetty and Websocket libs: <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> <version>9.4.1.v20170120</version> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-webapp</artifactId> <version>9.4.1.v20170120</version> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-annotations<