Using web socket with Tomcat 7

前端 未结 2 1921
北恋
北恋 2021-01-01 00:53

I would like to use web socket, and I started looking to do so with tomcat API. I\'m currently using Tomcat 7.0.37.

I tried to follow the example code from tomcat do

相关标签:
2条回答
  • 2021-01-01 01:40

    Is your inherited class MessageInbound implementing the Servlet interface? Can you provide the doGet implementation of your ChatWebSocketServlet or the MessageInbound class? Sorry man, your information is incomplete at all...

    0 讨论(0)
  • 2021-01-01 01:44

    I solved the issue !

    I tried to package the project with Maven on command line, and get this error:

    [ERROR] class file for org.apache.coyote.http11.upgrade.UpgradeInbound not found
    

    From this, I just added the following to the pom.xml:

    <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>tomcat-coyote</artifactId>
        <version>7.0.39</version>
        <scope>provided</scope>
    </dependency>
    

    I hope this will help others with the same issue.

    0 讨论(0)
提交回复
热议问题