Jetty WebSocket configuaration with WildFly

428 views
Skip to first unread message

Madhava Alampally

unread,
Jan 28, 2022, 10:50:51 AM1/28/22
to WildFly
Hi Team, 

Can you please let me know how to configure jetty WebSockets (Jetty 9.4.44 or Above) with WildFly?

I've tried to deploy Jetty along with my ear but facing the following issues.

If I use, 
javax-websocket-client-impl-9.4.44.v20210927.jar
javax-websocket-server-impl-9.4.44.v20210927.jar
websocket-client-9.4.44.v20210927.jar
websocket-server-9.4.44.v20210927
 along with other Jetty jars, I'm getting the following exception. 
-----------------------------------------------------------------------------------------------------------
java.lang.RuntimeException: javax.servlet.ServletException: Not running on Jetty, JSR-356 support unavailable
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:90)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
        at java.lang.Thread.run(Thread.java:748)
        at org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: java.lang.RuntimeException: javax.servlet.ServletException: Not running on Jetty, JSR-356 support unavailable
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:257)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:105)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:87)
        ... 8 more
Caused by: javax.servlet.ServletException: Not running on Jetty, JSR-356 support unavailable
        at org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer.onStartup(WebSocketServerContainerInitializer.java:271)
        at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:204)
        at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:187)
        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
        at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1535)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1535)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1535)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1535)
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:255)
-----------------------------------------------------------------------------------------------------------
If I remove the following jars from class path, I'm getting another exceptions.
javax-websocket-client-impl-9.4.44.v20210927.jar
javax-websocket-server-impl-9.4.44.v20210927.jar 
-----------------------------------------------------------------------------------------------------------
java.lang.IllegalStateException: Unable to find ServletContextHandler for provided ServletContext
-----------------------------------------------------------------------------------------------------------

Can someone help me on this? Or doc reference to configure the Jetty with WildFly

Thanks & Regards
Madhava

Madhava Alampally

unread,
Feb 6, 2022, 1:38:07 AM2/6/22
to WildFly
Hi Team,

If someone review my request and provides the feedback please.

Thanks & Regards
Madhava

This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

Madhava Alampally

unread,
Feb 6, 2022, 1:38:10 AM2/6/22
to WildFly

Emmanuel Hugonnet

unread,
Feb 7, 2022, 4:14:39 AM2/7/22
to Madhava Alampally, WildFly
Jetty is a servlet container, it can't be deployed in a Servlet Container, it will just conflict.
> the e-mail to the sender, delete it from your computer, and destroy any printed copy of it. --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/wildfly/CAKHt4MVbjnH_ERO8W3rR0UYnhTLBpM6iHLXrMr9%3D-WsG4ZtRCg%40mail.gmail.com
> <https://groups.google.com/d/msgid/wildfly/CAKHt4MVbjnH_ERO8W3rR0UYnhTLBpM6iHLXrMr9%3D-WsG4ZtRCg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Madhava Alampally

unread,
Feb 7, 2022, 5:10:30 AM2/7/22
to Emmanuel Hugonnet, WildFly
Thank you for your response. Earlier we used Jboss 5.x + Jetty 8.x as embedded for WebSockets which used to work as expected.
We upgraded JBoss to WildFly and it's working as expected with jetty 8.x.

The  problem begins when we upgrade Jetty to 9.x.  I hope it will clarify how we are using it.
Only the difference could be, Jetty 8.x is not JSR 356 compliant and Jetty 9.x is as per JSR 356.

Is there any way to use WildFly + Jetty for WebSockets?
How can I enable JSR 356 with undertow module to use WebE=Sockets

Thanks & Regards
Madhava





Reply all
Reply to author
Forward
0 new messages