简体   繁体   中英

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.

If i define a websocket endpoint in the war, all works fine: the clients open their connections and they exhchange messages. If I move the websocket endpoint in the EJB, the class not work and the connection from the client is never openend.

It's possible in Wildfly 9.0.2 define an endpoint inside an EJB module? 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

<?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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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