Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tomcat 9.0.31] Missing WebSocket ServerContainer #900

Open
boris-petrov opened this issue Feb 14, 2020 · 3 comments
Open

[Tomcat 9.0.31] Missing WebSocket ServerContainer #900

boris-petrov opened this issue Feb 14, 2020 · 3 comments

Comments

@boris-petrov
Copy link

@boris-petrov boris-petrov commented Feb 14, 2020

After updating Tomcat from 9.0.30 to 9.0.31 our integration tests don't want to even start due to:

FAILED org.cometd.server.BayeuxServerImpl@1ec3f0e5: java.lang.IllegalArgumentException: Missing WebSocket ServerContainer
java.lang.IllegalArgumentException: Missing WebSocket ServerContainer
        at org.cometd.websocket.server.WebSocketTransport.init(WebSocketTransport.java:72)
        at org.cometd.server.BayeuxServerImpl.initializeServerTransports(BayeuxServerImpl.java:255)
        at org.cometd.server.BayeuxServerImpl.doStart(BayeuxServerImpl.java:135)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.cometd.server.CometDServlet.init(CometDServlet.java:64)
        at org.cometd.annotation.AnnotationCometDServlet.init(AnnotationCometDServlet.java:52)
        at javax.servlet.GenericServlet.init(GenericServlet.java:158)
        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1134)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1089)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:983)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4871)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5180)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.startup.Tomcat.start(Tomcat.java:467)
        ...

I'm not sure whether this is a Tomcat issue or a CometD one or I'm doing something wrong but it was working before... how do I begin debugging this? I have these dependencies (among others):

integrationTestRuntimeOnly "org.apache.tomcat.embed:tomcat-embed-websocket:$tomcatVersion"
integrationTestRuntimeOnly "org.cometd.java:cometd-java-server:$cometDVersion"
integrationTestRuntimeOnly "org.cometd.java:cometd-java-websocket-javax-server:$cometDVersion"

CometD version is 3.1.12.

@sbordet

This comment has been minimized.

Copy link
Member

@sbordet sbordet commented Feb 17, 2020

@boris-petrov the place where this exception is thrown is here.

This is the JSR 356 standard way to obtain the WebSocket ServerContainer, so Tomcat must expose it as per specification.

I don't know why it was working before, but this code in CometD did not change because it's the standard and only way of accessing the WebSocket container.

Have you asked the Tomcat project?

@boris-petrov

This comment has been minimized.

Copy link
Author

@boris-petrov boris-petrov commented Feb 17, 2020

@sbordet - I haven't asked there yet, no. So this cannot be an application-configuration issue but is rather a Tomcat problem for sure? Or it's possible I'm not doing something right?

@sbordet

This comment has been minimized.

Copy link
Member

@sbordet sbordet commented Feb 17, 2020

@boris-petrov I don't know. I don't think it's a CometD issue.

Could be your application configuration, or how you configure Tomcat, or how you package your webapp.

If it was Jetty, I would say that you have either misconfigured your JETTY_BASE if you use Jetty standalone server, or you have forgot some jar in the classpath if you use Jetty embedded.

Try to enable DEBUG logging for Tomcat, and you should see if there are errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.