I'm using Weld in Open Liberty and seeing a NullPointerException from
WeldInitialListener when an app fails to start. The scenario goes
something like this:
1) Server and app starts to start.
2) An error occurs in my app code throwing an uncaught exception.
3) Liberty's web container code then attempts to stop the
still-not-yet-started app - this calls the WeldInitialListener's
contextDestroyed method without ever calling the contextCreated method.
4) Because contextCreated was never called, there is a NullPointerException
thrown from contextDestroyed (the lifecycle field is null), which ends up
masking the root cause of the problem.
I am in the process of fixing part of the problem (not logging the original
exception) in Open Liberty issue 13124, but I wonder if we should also
check if lifecycle is null in the contextDestroyed method to avoid the