[undertow-dev] Classpath conflict with Tyrus client

Stuart Douglas sdouglas at redhat.com
Tue Apr 5 18:19:53 EDT 2016


I will change this, but you should be able to work around it by
setting the worker and buffers on your WebSocketDeploymentInfo.


Stuart

On Tue, Apr 5, 2016 at 10:37 PM, Christian Bauer
<mail at christianbauer.name> wrote:
> Hi
>
> I'm creating and testing websockets in my project and I have the following classpath:
>
>     compile "io.undertow:undertow-servlet:$undertowVersion"
>     compile "io.undertow:undertow-websockets-jsr:$undertowVersion"
>     testCompile "org.glassfish.tyrus:tyrus-client:$tyrusVersion"
>     testCompile "org.glassfish.tyrus:tyrus-container-grizzly-client:$tyrusVersion"
>
> This doesn't work:
>
> Caused by: java.lang.ClassCastException: org.glassfish.tyrus.client.ClientManager cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer
>         at io.undertow.websockets.jsr.Bootstrap.handleDeployment(Bootstrap.java:62)
>         at io.undertow.servlet.core.DeploymentManagerImpl.handleExtensions(DeploymentManagerImpl.java:252)
>         at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:152)
>
> The code in Bootstrap.java randomly picks an implementation through ServiceLoader and tries to cast it:
>
> https://github.com/undertow-io/undertow/blob/master/websockets-jsr/src/main/java/io/undertow/websockets/jsr/Bootstrap.java#L62
>
> Why not load the desired type directly? Should I be able to deploy several websocket implementations? If not, what's the best option for testing?
>
> Thanks,
> Christian
>
>
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev


More information about the undertow-dev mailing list