简体   繁体   English

Wildfly:可以在 EAR 的 EJB 模块内定义 websocket 端点吗?

[英]Wildfly: is possible to define websocket endpoint inside an EJB module of an EAR?

I have an EAR with inside an EJB module and a WAR module... a classic situation.我有一个 EAR,里面有一个 EJB 模块和一个 WAR 模块……一个经典的情况。

If i define a websocket endpoint in the war, all works fine: the clients open their connections and they exhchange messages.如果我在战争中定义了一个 websocket 端点,一切正常:客户端打开它们的连接并交换消息。 If I move the websocket endpoint in the EJB, the class not work and the connection from the client is never openend.如果我在 EJB 中移动 websocket 端点,则该类不起作用并且来自客户端的连接永远不会打开。

It's possible in Wildfly 9.0.2 define an endpoint inside an EJB module?在 Wildfly 9.0.2 中可以在 EJB 模块内定义端点吗? How can I do?我能怎么做?

它类似于将 EJB 暴露为 REST 端点——这些端点只能在 WAR 模块中工作。

I added a new websocket server defined with the @ServerEndpoint annotation value of "pdfservice" into an existing war project that is packaged inside an ear and deployed on wildfly 10. The jboss-web.xml already existed as我添加了一个使用“pdfservice”的@ServerEndpoint 注释值定义的新 websocket 服务器到一个现有的战争项目中,该项目打包在一个耳朵内并部署在 Wildfly 10 上。 jboss-web.xml 已经存在

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
  <context-root>/pdf</context-root>
</jboss-web>

The websocket server was available at ws://<host:port>/pdf/pdfservice websocket 服务器位于 ws://<host:port>/pdf/pdfservice

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM