I have one bean called LoadSelectItemsBean
which is @ApplicationScoped
and holds various select item lists which I want to be shared amongst all users of the system.
I would like this LoadSelectItemsBean
bean to be a @ManagedProperty
in two other beans. When I added the select item bean into another bean as a managed property it works fine (shown in following code snippet):
@RequestScoped
@ManagedBean
public class GeneralCarrierDataViewBean implements Serializable {
private static final long serialVersionUID = 1L;
@ManagedProperty(value = "#{loadSelectItemsBean}")
private LoadSelectItemsBean selectItems;
However, when I try to add the select items bean as managed property in another bean, I start to experience problems. I use the same code in my AllianceViewBean
:
@RequestScoped
@ManagedBean
public class AllianceViewBean implements Serializable {
private static final long serialVersionUID = 1L;
@ManagedProperty(value = "#{loadSelectItemsBean}")
private LoadSelectItemsBean selectItems;
But when trying to load the application I receive the exception
com.sun.faces.mgbean.ManagedBeanPreProcessingException: Unexpected error processing managed property selectItems
My question is, can you declare one bean as a managed property in more than one other bean?
Thanks.
EDIT: My error has been solved, but I am still no closer to identifying why it could have originally occurred