From 467c770b4de997b00508f1d8423615a251464e74 Mon Sep 17 00:00:00 2001 From: Michael Irwin Date: Mon, 4 Nov 2013 14:47:22 -0500 Subject: [PATCH] Handle UnsupportedOperationException from getInstalledExtensions in Glassfish 4.0 --- .../support/GlassFish40RequestUpgradeStrategy.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFish40RequestUpgradeStrategy.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFish40RequestUpgradeStrategy.java index ed2508e538..5afe02f47c 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFish40RequestUpgradeStrategy.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFish40RequestUpgradeStrategy.java @@ -17,11 +17,16 @@ package org.springframework.web.socket.server.support; import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.List; + +import javax.websocket.WebSocketContainer; import org.glassfish.tyrus.core.EndpointWrapper; import org.glassfish.tyrus.spi.SPIEndpoint; import org.glassfish.tyrus.websockets.WebSocketApplication; import org.springframework.util.ClassUtils; +import org.springframework.web.socket.support.WebSocketExtension; /** @@ -34,6 +39,14 @@ import org.springframework.util.ClassUtils; */ public class GlassFish40RequestUpgradeStrategy extends AbstractGlassFishRequestUpgradeStrategy { + protected List getInstalledExtensions(WebSocketContainer container) { + try { + return super.getInstalledExtensions(container); + } + catch (UnsupportedOperationException e) { + return new ArrayList(); + } + } protected WebSocketApplication createTyrusEndpoint(EndpointWrapper endpoint) { try {