I am using a @ManagedBean(request scoped) as a @ManagedProperty inside another @ManagedBean. However the bean(one used as a @ManagedProperty) at the time of usage is un-instantiated and therefore leads to NullPointerException.
How can I resolve this issue ?
You’re apparently trying to access it in the constructor of the parent bean. This is indeed not possible. The managed properties are injected after construction.
The earliest access point is a
@PostConstructmethod. It’s invoked after construction and managed property (and all other dependency like@EJB) injection.