You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Jetty10RequestUpgradeStrategy for websocket support in Jetty 10.0.7 i get the following exception on the upgrade call:
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2 at org.springframework.web.socket.server.jetty.Jetty10RequestUpgradeStrategy$WebSocketCreatorInterceptor.invoke(Jetty10RequestUpgradeStrategy.java:161) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) at com.sun.proxy.$Proxy161.createWebSocket(Unknown Source) at org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer.lambda$upgrade$2(JettyWebSocketServerContainer.java:173) at org.eclipse.jetty.websocket.core.server.internal.CreatorNegotiator.lambda$negotiate$0(CreatorNegotiator.java:64) at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1445) at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1482) at org.eclipse.jetty.websocket.core.server.internal.CreatorNegotiator.negotiate(CreatorNegotiator.java:63) at org.eclipse.jetty.websocket.core.server.internal.AbstractHandshaker.upgradeRequest(AbstractHandshaker.java:76) at org.eclipse.jetty.websocket.core.server.internal.HandshakerSelector.upgradeRequest(HandshakerSelector.java:39) at org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer.upgrade(JettyWebSocketServerContainer.java:177) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) at org.springframework.web.socket.server.jetty.Jetty10RequestUpgradeStrategy.upgrade(Jetty10RequestUpgradeStrategy.java:118) ... 96 common frames omitted
The reason seems to be the WebSocketCreatorInterceptor and in here the
Thanks for the report. This was previously reported in #27899 and fixed in 5.3.15, which was already released so you should be able to just upgrade for the fix.
Affects: spring-websocket: 5.3.14, Jetty 10.0.7
When using the Jetty10RequestUpgradeStrategy for websocket support in Jetty 10.0.7 i get the following exception on the upgrade call:
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2 at org.springframework.web.socket.server.jetty.Jetty10RequestUpgradeStrategy$WebSocketCreatorInterceptor.invoke(Jetty10RequestUpgradeStrategy.java:161) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) at com.sun.proxy.$Proxy161.createWebSocket(Unknown Source) at org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer.lambda$upgrade$2(JettyWebSocketServerContainer.java:173) at org.eclipse.jetty.websocket.core.server.internal.CreatorNegotiator.lambda$negotiate$0(CreatorNegotiator.java:64) at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1445) at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1482) at org.eclipse.jetty.websocket.core.server.internal.CreatorNegotiator.negotiate(CreatorNegotiator.java:63) at org.eclipse.jetty.websocket.core.server.internal.AbstractHandshaker.upgradeRequest(AbstractHandshaker.java:76) at org.eclipse.jetty.websocket.core.server.internal.HandshakerSelector.upgradeRequest(HandshakerSelector.java:39) at org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer.upgrade(JettyWebSocketServerContainer.java:177) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) at org.springframework.web.socket.server.jetty.Jetty10RequestUpgradeStrategy.upgrade(Jetty10RequestUpgradeStrategy.java:118) ... 96 common frames omitted
The reason seems to be the WebSocketCreatorInterceptor and in here the
@Nullable @Override public Object invoke(@NonNull MethodInvocation invocation) { if (this.protocol != null) { ReflectionUtils.invokeMethod( setAcceptedSubProtocol, invocation.getArguments()[2], this.protocol); } return this.adapter; }
The proxy is created from the jetty based interface
JettyWebSocketCreator
which has only two arguments.The text was updated successfully, but these errors were encountered: