Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
WebSockets support not working on DXP 7.1
Does anybody knows if websockets based communication works on a Liferay instance running on a WebLogic server? I deployed the websocket-echo-portlet on an Liferay instance running on a Tomcat server to test if websocket based communication was working or not, and it all worked as expected. However, when the same portlet was deployed on a Liferay instance running on a WebLogic server, it didn't work.
More specifically, on the 'websocket-echo-portlet' view, when I press the buttom 'Connect', the following message is displayed in the 'debug-area-text' text area of the portlet :
ERROR: undefined - DISCONNECTED
When looking at the log file, there it appears the following message:
2023-10-25 14:40:02.721 WARN [[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'][code_jsp:174] {code="404", msg="/o/echo", uri=/o/echo}
When I stop-start OSGi module 'com.liferay.websocket.whiteboard' on a Gogo console (once set the debug level value to 'TRACE' for the Logger 'com.liferay.websocket' through the Control Panel of the Liferay instance), and then I look at the log file, there it appears the following message:
2023-10-25 14:45:51.996 INFO [Thread-56][BundleStartStopLogger:38] STOPPED com.liferay.websocket.whiteboard_2.0.0 [710]
2023-10-25 14:46:12.922 INFO [Thread-56][WebSocketEndpointTracker:59] A WebSocket server container is not registered
2023-10-25 14:46:12.923 INFO [Thread-56][BundleStartStopLogger:35] STARTED com.liferay.websocket.whiteboard_2.0.0 [710]
That message is thrown by the 'com.liferay.websocket.whiteboard.internal.WebSocketEndpointTracker' class (see it on GitHub), when the 'serverContainer' variable is null, that is, when the sentence '_servletContext.getAttribute("javax.websocket.server.ServerContainer")' returns 'null'.
Does anybody know why the sentence '_servletContext.getAttribute("javax.websocket.server.ServerContainer")' is working as expected on a Tomcat server but it isn't on a WebLogic server? It seems as if, on a WebLogic server, it was required to set any additional setting so that the 'com.liferay.websocket.whiteboard' module works.
Any clarification will be appreciated. Thanks in advance.
Background:
Liferay DXP 7.1.10-ga1, WebLogic 12.2.1.4, openjdk-1.8.0.232-1.
Powered by Liferay™