【问题标题】:404 on websocket endpoint when Jersey ServletContainer is on "/*"当 Jersey ServletContainer 位于“/*”时,websocket 端点上的 404
【发布时间】:2022-01-16 06:09:51
【问题描述】:

我有一个在 Wildfly 上运行 jersey (2.30) 的 JavaEE 应用程序。该应用程序在“/rest1”和“/rest2”上有两个rest应用程序,在“/somews”上有一个websocket。 我需要将其余两个应用程序合并为一个,因此我必须将“/*”定义为应用程序路径。我能够使用 staticContentRegex 参数提供静态资源,但如果我尝试连接到 websocket,我会收到 404 错误。 看起来 jersey servlet 正在干扰 websocket 端点,但这是为什么呢?它们使用不同的协议,所以我认为这不是问题。

马可。

【问题讨论】:

    标签: rest websocket jersey wildfly jersey-2.0


    【解决方案1】:

    如果有人遇到同样的问题:我有一个自定义 ExceptionMapper,对于 NotFoundException,它总是返回带有实体的响应。

    【讨论】:

    • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 2013-03-12
    • 2018-12-13
    • 1970-01-01
    • 1970-01-01
    • 2013-10-29
    • 1970-01-01
    • 1970-01-01
    • 2018-01-17
    • 2013-06-23
    相关资源
    最近更新 更多