I've been trying to solve an issue where my managedBean is sometimes null (I get the target unreachable error message saying that the bean is null) and this intermittent issue usually occurs if I tinker in the @PostConstruct method.
While booting up the application I really don't see any errors, but as soon as I try to interact with the bean via XHTML, BOOM! Bean is null. I read through the @PostConstruct documentation and it says that if an exception should occur, "the bean is not put into service" does this mean that JSF won't create/handle the bean. Can a failing @postConstruct be the cause of my null bean (based on what I've mentioned)? If say the @PostConstruct where failing for some reason, why am I not seeing the exception in the server log (is it supposed to fail gracefully)?
Sorry, this is theoretical but it's the only thing that makes sense to me, and showing code really won't help since it's so difficult to root cause.
Another question - How can I catch/debug any issues in the @PostConstruct?
Thanks for your time, sorry If I didn't follow some Q&A Stackoverflow guidelines.