【问题标题】:jetty-maven-plugin closes websocket with CloseReason[1006,WebSocket Read EOF] on any message send to clientjetty-maven-plugin 在发送给客户端的任何消息上使用 CloseReason[1006,WebSocket Read EOF] 关闭 websocket
【发布时间】:2017-04-14 21:56:13
【问题描述】:

我有 java 服务器应用程序,它在 pom.xml 中使用 jetty-maven-plugin

        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>9.3.14.v20161028</version>
            <configuration>
                <stopKey>STOP_LOCAL</stopKey>
                <stopPort>30474</stopPort>
                <systemProperties>
                    <systemProperty>
                        <name>java.net.preferIPv4Stack</name>
                        <value>true</value>
                    </systemProperty>
                </systemProperties>
                <webAppConfig>
                    <contextPath>/myApp</contextPath>
                    <jettyEnvXml>src/main/resources/jetty-env.xml</jettyEnvXml>
                </webAppConfig>
            </configuration>
        </plugin>

还有

    <dependency>
        <groupId>javax.websocket</groupId>
        <artifactId>javax.websocket-api</artifactId>
        <version>1.1</version>
        <scope>provided</scope>
    </dependency>

如果我通过 eclipse maven build 使用目标 jetty:run 启动服务器,我的服务器无法将任何消息发送回客户端。

在我调用 javax.websocket.Session.getAsyncRemote().sendText(jsonMessage) 之后,Websocket 正在使用 CloseReason[1006,WebSocket Read EOF] 关闭

(我正在使用简单的 google chrome websocket 客户端进行测试)

但是,如果我将我的应用程序打包到 war 并在 Tomcat 8.5.4 下启动它,一切都会像魅力一样工作。

请帮忙找出原因。

【问题讨论】:

    标签: java eclipse maven-jetty-plugin java-websocket


    【解决方案1】:

    卡巴斯基关闭 ws 连接,并没有关闭 wss :(

    【讨论】:

      猜你喜欢
      • 2019-08-10
      • 2017-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-31
      • 2021-07-18
      • 2015-01-17
      • 1970-01-01
      相关资源
      最近更新 更多