Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

NPE at WebSocketSession.java, public Principal getUserPrincipal() method #5850

Closed
padisah opened this issue Dec 31, 2020 · 1 comment · Fixed by #5852
Closed

NPE at WebSocketSession.java, public Principal getUserPrincipal() method #5850

padisah opened this issue Dec 31, 2020 · 1 comment · Fixed by #5852
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@padisah
Copy link

padisah commented Dec 31, 2020

Jetty version
10.0
Java version
11.0
OS type/version
Xubuntu 20.04
Description

the WebSocketSession.getUserPrincipal reads for this.frameHandler.getUpgradeRequest()
but the JavaxWebSocketFrameHandler.upgradeRequest is null

the setter for upgradeRequest has no reference, and in my debugging, it wasn't called
the method JavaxWebSocketFrameHandlerFactory.newJavaxWebSocketFrameHandler

https://github.com/eclipse/jetty.project/blob/jetty-10.0.x/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java#L116

... creates the JavaxWebSocketFrameHandler instance, without setting the upgradeRequest to it, while it receives as a parameter

The actual issue we are facing is that after upgrade from 9.4 jetty to 10.0 jetty, there is a nullpointer exception in a series of Vaadin applications. The error was present with Vaadin 8, Vaadin 14, and Vaadin 18, latest minor versions.

The Vaadin exception occures on first pageload, or login attempts.
I didn't find resources yet on Vaadin jetty upgrades yet, this is quite new, probably few people tried it yet.

@joakime joakime added the Bug For general bugs on Jetty side label Dec 31, 2020
lachlan-roberts added a commit that referenced this issue Jan 4, 2021
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jan 4, 2021
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@lachlan-roberts
Copy link
Contributor

@padisah this has now been fixed in the 10.0.x branch, the fix will be available in a 10.0.1 release.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants