Page 2 of 2

Re: PrimeFaces PUSH Showcase

Posted: 06 Sep 2016, 13:18
by andyba
Even without the Exceptions I get

Code: Select all

WARN:   WELD-000714: HttpContextLifecycle guard leak detected. The Servlet container is not fully compliant. The value was 1
WARN:   WELD-000715: HttpContextLifecycle guard not set. The Servlet container is not fully compliant.
which means things are broken.

Re: PrimeFaces PUSH Showcase

Posted: 06 Sep 2016, 14:08
by andyba
Even simply restarting the server with the app deployed doesn't work and yields different results each time.
I am going to have to create a Counter example on its own and see how that does.
I have a feeling I may also have to upgrade to the next Glassfish version.

Re: PrimeFaces PUSH Showcase

Posted: 06 Sep 2016, 18:31
by andyba
I have deployed to Payara 4.1.1 and made sure that WebSocket support is switched on (it is by default).
Atmosphere is reporting that WebSocket is not supported "Error during WebSocket handshake: Unexpected response code: 501" and falls back to long-polling.
Still nothing works.

I could really do with some help on this rather than supplying my own answers all the time as nothing I can find to do with Atmosphere and PrimeFaces Push or Glassfish/Payara is giving me any helpful information.

Re: PrimeFaces PUSH Showcase

Posted: 06 Sep 2016, 19:22
by tandraschko
i would help but i have no experience regarding atmosphere. I can just apply fixes if you would like to provide some patches/PRs for possible bugs.

Re: PrimeFaces PUSH Showcase

Posted: 07 Sep 2016, 09:37
by andyba
tandraschko wrote:i would help but i have no experience regarding atmosphere. I can just apply fixes if you would like to provide some patches/PRs for possible bugs.
If I find the time for it, I would. Unfortunately I have more than enough to do keeping the project I am paid to for above water.
If I do find something I will certainly start and issue.

At the moment, running with Payara, the publish and @PushEndpoint classes are working however that is all that is happening. Chrome falls back to long-polling even though the server supports WebSocket.

I am going to put the PUSH issues on the back burner but start an investigation using a simple PUSH app using server generated messages pushed to the client (which is what we use PUSH for).
That way I can avoid issues that may be caused by other parts of the migrated application.

On a side note: PUSH has been the only issue that caused me any problems when migrating our webapp from 4.0.8 to 6.0, apart from a few minor CSS issues to do with our custom Theme the migration was easy.

Re: PrimeFaces PUSH Showcase

Posted: 07 Sep 2016, 16:30
by andyba
There is a @ServerEndpoint("/*") which appears to swallow all the WebSocket sessions but doesn't manage them very well, this means that you get intermittent connections for a given path back to the client.

As a quick exercise I decided to implement a native WebSocket demo using my simple PrimeFaces test, pretty much going back to basics and no longer using the Atmosphere dependency.

Everything worked!

This means that there are some serious deficiencies in the Atmosphere runtime that need to be addressed.

- It does not recognise that native WebSocket is supported even when it is on Payara 4.1.1 or Glassfish 4.1
- Atmosphere is not doing a very good job of associating sessions to paths.
- these problems are intermittent with some chance of things working as expected but a much greater chance of them not working at all, for no apparent reason.

For me the path of least resistance lies in developing a native WebSocket client that covers our needs

- Server PUSH only, no messages received from the browser
- We only support 1 browser: Chrome and this supports native WebSockets off the bat. In reality FireFox and Edge support native WebSocket too but we only guarantee operation in Chrome.

Re: PrimeFaces PUSH Showcase

Posted: 07 Sep 2016, 20:30
by smithh032772
Andy, I read your posts, and all I have to say is the following:

1. I have only used the Notify example in the PrimeFaces Push showcase in my app, which is a server-to-client push example
2. When I migrated from PrimeFaces 4.0 to 5.0 to 6.0, I had to make several changes in the .java classes only because of Atmosphere API changes
3. when I used Glassfish 3.x in the past, I migrated to TomEE, and ever since, PrimeFaces Push (and Atmosphere) works in my app, as/since I require Google Chrome browser, even though I have a few Apple Safari endusers (iPad and iPhone users).
4. When Jeanfrancois stopped working on Atmosphere, I stopped upgrading Atmosphere, and PrimeFaces Push is still working well in my app.

My signature tells it all, what versions I am using. :)

Re: PrimeFaces PUSH Showcase

Posted: 09 Sep 2016, 13:55
by andyba
smithh032772 wrote:Andy, I read your posts, and all I have to say is the following:

1. I have only used the Notify example in the PrimeFaces Push showcase in my app, which is a server-to-client push example
2. When I migrated from PrimeFaces 4.0 to 5.0 to 6.0, I had to make several changes in the .java classes only because of Atmosphere API changes
3. when I used Glassfish 3.x in the past, I migrated to TomEE, and ever since, PrimeFaces Push (and Atmosphere) works in my app, as/since I require Google Chrome browser, even though I have a few Apple Safari endusers (iPad and iPhone users).
4. When Jeanfrancois stopped working on Atmosphere, I stopped upgrading Atmosphere, and PrimeFaces Push is still working well in my app.

My signature tells it all, what versions I am using. :)
TomEE is not an option for this project, we do things that use a lot of things that Glassfish does to support java EE apps out of the box.
Hence the move to Payara (the latest GF version is ropy to say the least).
We also have to support mobile devices in the future which is why I have been asked to invest time in migrating our current 4.08 supported version to PF 6.0.
I have managed to replace the entire PrimeFaces PUSH (and atmosphere) with the native WebSockets library of my own development in less than 2 days.
It only supports native WebSockets (we only support browsers that have native WebSockets anyway), has full client/server push functionality with dynamic channels and parameter passing.
Because: I R good at this.

Oh and the migration has now been completed with a version being delivered to our QM chappies in the near future. Apart from PUSH it was a painless experience.
Now looking forward to stuffing our UI into a Premium Ultima theme!

Re: PrimeFaces PUSH Showcase

Posted: 09 Sep 2016, 21:38
by smithh032772
Congrats, Andy, on the success! I am looking forward to migrating to one of the new responsive PrimeFaces themes as well, so I don't have to do as much client-side coding (via PrimeFaces Mobile JSF xhtml). Premium Ultima theme would be my choice/preference as well.