-
Bug
-
Resolution: Done
-
Minor
-
5.1.1.SP2
-
None
If something goes wrong early in the startup of a web app such that WeldInitialListener.contextInitialized is not called, it will throw a NullPointerException if WeldInitialListener.contextDestroyed is called.
This can only happen if the servlet container calls contextDestroyed without first calling contextInitialized, but we couldn't find anything in the servlet spec that gives a guarantee that this won't happen.
It also doesn't cause much harm because this only occurs if the app fails to start, but it does cause confusion to users debugging problems because the exception in the logs can look like the cause of the application startup failure rather than a symptom of it.
Can we add a check to WeldInitialListener.contextDestroyed to make sure lifecycle has been initialized before calling it?
Related Open Liberty issue: https://github.com/OpenLiberty/open-liberty/issues/26054