You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Pierre Villard (Jira)" <ji...@apache.org> on 2025/07/31 16:31:00 UTC
[jira] [Updated] (NIFI-14170) ListenWebSocketProcessor doesn't work: "org.eclipse.jetty.ee10.servlet.ServletApiRequest.getRequest()" is null
[ https://issues.apache.org/jira/browse/NIFI-14170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pierre Villard updated NIFI-14170:
----------------------------------
Assignee: RAVINARAYAN SINGH
Status: Patch Available (was: Open)
> ListenWebSocketProcessor doesn't work: "org.eclipse.jetty.ee10.servlet.ServletApiRequest.getRequest()" is null
> --------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-14170
> URL: https://issues.apache.org/jira/browse/NIFI-14170
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Affects Versions: 2.1.0
> Reporter: Andrei Koiro
> Assignee: RAVINARAYAN SINGH
> Priority: Major
> Attachments: NiFi_Flow.json, Screenshot 2025-01-17 at 00.35.06.png
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
>
> {code:java}
> 2025-01-16 23:58:02,114 WARN [qtp297136886-98] o.a.n.w.jetty.RoutingWebSocketListener Unhandled Error: Endpoint org.apache.nifi.websocket.jetty.RoutingWebSocketListener : org.eclipse.jetty.websocket.api.exceptions.CloseException: org.eclipse.jetty.websocket.core.exception.WebSocketException: RoutingWebSocketListener OPEN method error: Cannot invoke "org.eclipse.jetty.server.Request.isSecure()" because the return value of "org.eclipse.jetty.ee10.servlet.ServletApiRequest.getRequest()" is null {code}
> ListenWebSocketProcessor doesn't work
> It happens because our code tries to call org.eclipse.jetty.ee10.servlet.ServletApiRequest.getRequest() after the current ServletChannel already was "recycle"d
>
> org.apache.nifi.processors.websocket.ListenWebSocket
> {code:java}
> protected String getTransitUri(final WebSocketSessionInfo sessionInfo) {
> final InetSocketAddress localAddress = sessionInfo.getLocalAddress();
> return (sessionInfo.isSecure() ? "wss:" : "ws:")
> + localAddress.getHostName() + ":" + localAddress.getPort() + endpointId;
> }
> {code}
> org.eclipse.jetty.ee10.servlet.ServletChannel
> {code:java}
> void recycle(Throwable x)
> {
> // _httpInput must be recycled before _state.
> _httpInput.recycle();
> _httpOutput.recycle();
> _state.recycle();
> _servletContextRequest = null;
> _request = null;
> _response = null;
> _callback = null;
> }
> {code}
> org.eclipse.jetty.ee10.servlet.ServletContextHandler:1170
> {code:java}
> Request.addCompletionListener(servletContextRequest, servletChannel::recycle);
> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)