-
1. Re: @Inject dependency injection into WebSocket @ServerEndpoint
sfcoy Jun 1, 2013 10:15 PM (in response to markaddy)If you're trying this on AS7.x then it won't work because it's a Java EE6 container, which is not required to support web sockets.
If you're trying it on the WildFly 8.1 Alpha then it's possible that it's just not implemented yet.
Does it work if you try @EJB instead?
-
2. Re: @Inject dependency injection into WebSocket @ServerEndpoint
markaddy Jun 2, 2013 4:16 AM (in response to sfcoy)I'm trying on Wildfly Alpha1 and the latest stable build, both give the same result.
Also tried @EJB too with the same result.
{code}
@ServerEndpoint("/websocket")
public class WebSocketEndpoint implements Serializable {
@EJB
private TestEJB testEJB;
}{code}
-
3. Re: @Inject dependency injection into WebSocket @ServerEndpoint
mazz Jul 13, 2015 8:13 PM (in response to markaddy)Anyone know if this works on WildFly 9? I can't seem to get it to work using the same annotations.
UPDATE: Looks like it does work on WildFly 9 CR2 when you use @Inject. I was using @EJB and it did not work. Switched to @Inject, and it worked.