I have a Facade that has a persistence unit. And I need the Facade and it's dependencies initialized before the RoleController Conconstructor runs, is it possible in EJB 3.1 to do that ?
In Spring you simple add some parameters (preConstruction="true") to the @configurable and it's done.
But in EJB I cannot find a way to do that I always get a NullPointer...
@FacesConverter("rolesConverter")
@Named("roleController")
@SessionScoped
@TransactionManagement(TransactionManagementType.CONTAINER)
public class RoleController implements Serializable, Converter{
private List<Roles> listOfRoles;
private List<Roles> listChoosenRoles;
private DualListModel<Roles> listOfDualRoles;
@EJB
private RoleFacade roleFacade;
public RoleController(){
listOfRoles = roleFacade.getListOfRoles();
listChoosenRoles = new ArrayList();
listOfDualRoles = new DualListModel<Roles>(listOfRoles, listChoosenRoles);
}