WebSockets support not working on DXP 7.1

29 views Asked by At

I'm trying to test if WebSockets based communication works or not on a WebLogic server. To do so, I've deployed the websocket-echo-portlet on a Liferay DXP instance running on a WebLogic server, but it doesn't work. More specifically, when I press the buttom 'Connect' on the websocket-echo-portlet view, 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}

The weird thing happens when I stop-start the 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:

INFO  [Thread-56][BundleStartStopLogger:38] STOPPED com.liferay.websocket.whiteboard_2.0.0 [710]
INFO  [Thread-56][WebSocketEndpointTracker:59] A WebSocket server container is not registered
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, that is, when the _servletContext object doesn't have the attribute "javax.websocket.server.ServerContainer". And the question is why that attribute hasn't been set into the _servletContext object? That object has been declared this way:

@Reference(target = "(original.bean=true)")
private ServletContext _servletContext;

It seems as if, either (1) on a WebLogic server, or (2) on the OSGi's module framework it was required to set any additional setting so that the com.liferay.websocket.whiteboard module works as expected.

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, Windows 10.

(It all is sort of a cross-post issue)

0

There are 0 answers