Starting Jetty WebSockets with Undertow Container + WildFly

340 views
Skip to first unread message

Madhava Alampally

unread,
Apr 4, 2022, 10:11:14 AM4/4/22
to WildFly
Hi Team, 

We are able to start Jetty WebSocker server with Jetty version 8.1.19 in WildFly + Undertow container. 

However, when we tried to upgrade Jetty Version to 9.4.45 and starting WebSocket Server with undertow + WildFly, we are getting the deployment exceptions. 

Any help in this regard greatly appreciated as it's blocker for us. 

Deployment Error is:
2022-04-04 11:25:29,462 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 109) MSC000001: Failed to start service jboss.deployment.subunit."c2oear-snapshot.ear"."web-snapshot.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.subunit."c2oear-snapshot.ear"."web-snapshot.war".undertow-deployment: java.lang.RuntimeException: java.lang.IllegalStateException: Unable to find ServletContextHandler for provided ServletContext
    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: java.lang.IllegalStateException: Unable to find ServletContextHandler for provided ServletContext
    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: java.lang.IllegalStateException: Unable to find ServletContextHandler for provided ServletContext
    at org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer.onStartup(NativeWebSocketServletContainerInitializer.java:120)
    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)
Thanks & Regards
Madhava

James Perkins

unread,
Apr 4, 2022, 11:33:00 AM4/4/22
to WildFly
WildFly ships with a WebSockets implementation. Is there a reason you need to use Jetty?

Madhava Alampally

unread,
Apr 5, 2022, 12:03:06 AM4/5/22
to James Perkins, WildFly
Earlier we were using Jboss + Jetty 1.8.19 for WebSockets. We are upgraded to WildFly and it's working as expected with WildFly + Jetty 8.1.19

As Jetty 8.x is EOL, we are trying to upgrade to 9.x and we are getting the reported issue.  Can you please help us to fix this blocker?

Thanks & Regards,
Madhava

--
You received this message because you are subscribed to a topic in the Google Groups "WildFly" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wildfly/6H8wwi7Zvcs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/5fce0673-6bc3-4e0a-bf05-fa7dd6fda3bbn%40googlegroups.com.

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.

James Perkins

unread,
Apr 5, 2022, 11:17:11 AM4/5/22
to WildFly
I'm not really sure how to integrate a different implementation of WebSockets into WildFly. Do you have it installed as a module or is the implementation in your deployment? Given the error I'd assume your deployment. You'd need to know if there is some Jetty WebSocket configuration required. 

Like I said, WildFly already ships with a compliant WebSockets implementation so I'm not too sure how you replace that.

Madhava Alampally

unread,
Apr 6, 2022, 12:00:42 AM4/6/22
to James Perkins, WildFly
Thank you James for the response. Yes, you are right. The issue is as we are deploying the jetty jars along with the ear.
We moved them to a separate module and mentioned that module as dependency to our pom.xml to fix the issue. 

We are good for now. Thank you for your response on this matter.

Thanks & Regards
Madhava
 

Reply all
Reply to author
Forward
0 new messages