diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java index d6751bf8a63..6e7e2a2346b 100644 --- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java +++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/config/JettyWebSocketClientConfiguration.java @@ -20,6 +20,7 @@ package org.eclipse.jetty.websocket.client.config; import java.util.ServiceLoader; +import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.webapp.AbstractConfiguration; import org.eclipse.jetty.webapp.Configuration; import org.eclipse.jetty.webapp.FragmentConfiguration; @@ -71,7 +72,7 @@ public class JettyWebSocketClientConfiguration extends AbstractConfiguration { try { - return JettyWebSocketClientConfiguration.class.getClassLoader().loadClass(classname) != null; + return Loader.loadClass(classname) != null; } catch (Throwable e) { diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java index a9298485aa1..43920f6f6b3 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java @@ -20,6 +20,7 @@ package org.eclipse.jetty.websocket.server.config; import java.util.ServiceLoader; +import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.webapp.AbstractConfiguration; import org.eclipse.jetty.webapp.Configuration; import org.eclipse.jetty.webapp.FragmentConfiguration; @@ -75,7 +76,7 @@ public class JettyWebSocketConfiguration extends AbstractConfiguration { try { - return JettyWebSocketConfiguration.class.getClassLoader().loadClass(classname) != null; + return Loader.loadClass(classname) != null; } catch (Throwable e) {