Open sergey-morenets opened 6 years ago
I made small investigation effort and it turned out that WebsocketSessionManager cannot be found because this code is run in the separate thread created by Jetty(not connected to JSF lifecycle) and FacesContext is null.
A small comment: "FakeEndpoint" is typically only needed for Tyrus based Websocket implementations and not a general requirement for the feature.
Hi @arjantijms
Thank you for the comment. Unfortunately issue reproduces even if I remove this FakeEndpoint
That's indeed expected, just wanted to mention that the FakeEndPoint is by far not always needed, but when it's there it shouldn't hurt either. @BalusC is the one most up to date with the actual specifics of what might go wrong here.
Thanks for the report btw! ;)
Please see this important message regarding community contributions to Mojarra.
https://javaee.groups.io/g/jsf-spec/message/30
Also, please consider joining that group, as that group has taken the place of the old dev@javaserverfaces.java.net mailing list.
Thanks,
Ed Burns
I tried to test new WebSocket feature with JSF 2.3.3(Glassfish implementation). I used Jetty 9.4.7 as web server and followed this guide(https://javaserverfaces.github.io/whats-new-in-jsf23.html)
I created a managed bean:
updated index.xhtml:
updated web.xml:
And created fake endpoint:
Jetty starts up properly but when I open index.xhtml I get a lot of error messages like that:
java.lang.NullPointerException at com.sun.faces.cdi.CdiUtils.getBeanReferenceByType(CdiUtils.java:222) at com.sun.faces.cdi.CdiUtils.getBeanReference(CdiUtils.java:205) at com.sun.faces.push.WebsocketSessionManager.getInstance(WebsocketSessionManager.java:240) at com.sun.faces.push.WebsocketEndpoint.onOpen(WebsocketEndpoint.java:88)
So the issue is that WebsocketSessionManager bean cannot been found. And WebSocket feature is not available.
Thanks.