-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FISH-6072 Add null check to FilterRegistration #2
FISH-6072 Add null check to FilterRegistration #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you include a couple of commits which bumps the version number to .payara-p2 and .payara-p3-SNAPSHOT please?
Also I'm not sure this is the correct fix...
The reason we're getting a failure is because this initializer is being hit twice.
It gets initialized by the FacesInitializer
AND by itself as a ServletContainerInitializer
in its own right.
So leaving the null check where it is we get:
- The
TyrusServletContainer
of the second initializer as thejavax.websocket.server.ServerContainer
attribute of theServletContext
- Two
TyrusServletFilter
s asHttpSessionListener
s (one from each initializer run) - The
TyrusServletFilter
of the first initializer run registered as theFilter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't think this is the way to fix it - I think we've actually got a race condition here, and this is just a band-aid over the top of it.
FacesInitializer
and TyrusServletContainerInitializer
both still attempt to initialize a filter, with only FacesInitializer
checking if the filter is already present. The order that these happen in is undefined, it's just whatever order the initializers are found in (this order only changes on server restart, not on application redeploy).
So if FacesInitializer
attempts to start first then we're in the same boat as before with Tyrus starting and registering everything twice (now just with different names), and in fact we get an error from this with one of the filters failing to start:
Exception starting filter 3fdc48ef-b66a-4fd4-a99d-71770c97656e
java.lang.InstantiationException
...
Caused by: javax.websocket.DeploymentException: Found equivalent paths. Added path: '/JSF23WebSocket-1.0/javax.faces.push/{channel}' is equivalent with '/JSF23WebSocket-1.0/javax.faces.push/{channel}'
I think we should have a proper sit down to look through this together to make sure we iron it out properly, though I suspect it may simply be a case of adding a similar null check to the Tyrus onStartup similar to Faces (either that or ensuring Tyrus always starts before Faces, though that's probably just another bandaid).
Side note, as you can tell from the log message, just using a UUID as the name of the filter makes the log a bit unhelpful from a user POV :P
payara/Payara#5640