tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sambit nayak <>
Subject Facing issue with web socket client in Tomcat 7
Date Wed, 04 Nov 2015 05:49:57 GMT

I am trying to run a Web socket client under the context of Tomcat. So the
scenario is, I have a Web socket Server Endpoint deployed on Tomcat, as
part of App-1. App-2, which is also deployed on Tomcat (obviously under
different context root), wants to send a message.

The class in App-2 works fine, if I run it as a stand alone from a main
method. But it gives the below error, when it runs under context of tomcat.
(I am using Tyrus 1-9 as JSR-356 impl. If I remove it from pom dependency
list, @clientEndpoint and related annotations are not identified.)

> java.util.ServiceConfigurationError: javax.websocket.ContainerProvider:
> Provider org.apache.tomcat.websocket.WsContainerProvider not a subtype
> at
> at java.util.ServiceLoader.access$300(
> at java.util.ServiceLoader$LazyIterator.nextService(
> at java.util.ServiceLoader$
> at java.util.ServiceLoader$
> at
> javax.websocket.ContainerProvider.getWebSocketContainer(

The above exception is thrown at this line: WebSocketContainer container =

I have tried below methods:

   - From javax.websocket.ContainerProvider documentation

"Provider class that allows the developer to get a reference to the
implementation of the WebSocketContainer. The provider class uses the
<> to
load an implementation of ContainerProvider. Specifically, the fully
qualified classname of the container implementation of ContainerProvider
must be listed in the META-INF/services/javax.websocket.ContainerProvider
file in the implementation JAR file.

 I looked in the META-INF of tomcat7-websocket.jar and tried changing the
entry to another impl class in Tyrus (GrizzlyContainerProvider), but that
does not help.

   - Change the above line to

WebSocketContainer container = GrizzlyContainerProvider.getWebSocketContainer();

Both methods do not work.Any suggestion on how to fix this will be very

I am running Tomcat 7.0.54 on Mac OS X 10.10.5.

Thanks & Regards
Sambit Nayak

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message