Migration from Glassfish to Payara -- websocket issue

Hello,

We are migrating from Glassfish4 and one of our services uses websockets. Websockets work fine on Glassfish, but when deploying the same war to Payara, it behaves strangely. The connection is able to open and the session is maintained, but whenever the server tries to send a message to the client, nothing happens until the connection is closed. The outgoing messages are all sent to the client only when the connection closes.

Nothing has changed with the war between deploying on Glassfish and Payara.

Any help with troubleshooting this would be greatly appreciated.

Hi @jrumsey,

We have a small example of a working example using websockets on Payara 5 in our Payara Examples repository which you may find useful to compare to your application Payara-Examples/javaee/websockets at master · payara/Payara-Examples · GitHub

Additionally, if you are able to share a small, easy to follow reproducer for this issue I would be able to investigate your exact issue.

Could you also please confirm which version of Payara 5 you are upgrading to?

Thanks,
James

Hmm I am having pretty much the same issue with the test project. It opens a connection successfully but is unable to send a message to the client. The only difference is that the test project isn’t sending all the messages onClose anymore.

The version is 5.2021.3

Hi @jrumsey,

I would recommend you upgrade to the latest version of Payara Community 5.2022.2 as that way I can properly provide you support here on the forums.

If you wish to use an older version of Payara, I would recommend a Payara Enterprise subscription

If the problem persists on the latest version of Payara Community edition, please let me know and I will further investigate this issue, and attempt to reproduce the issue you are reporting with the test project.

Thanks,
James

We upgraded to 5.2022.2 and have the same results.

Hi @jrumsey,

Could you please provide a simple to follow scenario how to reproduce this? A reproducer should ideally follow the SSCCE rules: http://www.sscce.org/. It will greatly help us to find the cause and fix it.

Thanks,
James

I setup the websocket project you mentioned earlier and then built and deployed the war to payara. I am able to open a websocket connection along with close it. The client is able to send messages to the server successfully, but the server is unable to send any messages back to the client. There is a try/catch in the code where the server tries to send a message back to the client but there is nothing caught.