1

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?

Daniele Licitra
  • 1,520
  • 21
  • 45

2 Answers2

0

It is similar to exposing EJB's as REST endpoints - those will work only in WAR modules.

iskramac
  • 868
  • 6
  • 14
  • That is not really true. I can expose EJB REST webservices passing jndi of ejb to the javax.ws.rs.core.Application , reading those jndi from a db. Maybe there is a similar solution for websocket – Daniele Licitra Mar 23 '17 at 14:44
0

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

JohnC
  • 1
  • Hi! This is the standard behaviour. The problem is when you move the server-class from WAR package to another EJB-module package in the same EAR. – Daniele Licitra Nov 30 '20 at 12:08