I have an issue with a customer converter I have written. I am calling my DAL from converter and injecting it as a managed property. When I call the converter from one of my ui components everything works properly; however when I call it from another component the injected DAL is null. I apologize if this is a dupe, I have looked all over the place to find an answer.
I am using primefaces 3.5.
Here is the converter:
@ManagedBean(name = "fanlistConverter")
public class FanlistConverter implements Converter, Serializable {
private  List<Fanlist> fanlist; 
@ManagedProperty(value="#{dAL}")
private DAL dAL;
private static Session session;
public FanlistConverter(){
} 
@PostConstruct
public void init(){
    session  = dAL.getSession();
}
public Object getAsObject(FacesContext facesContext, UIComponent component, String submittedValue) {  
    if (!submittedValue.equals(null) &&  !submittedValue.equals("null")) {  
        Fanlist fanlist = new Fanlist();
        try {  
                fanlist = (Fanlist)session.get(Fanlist.class, UUID.fromString(submittedValue));
            } catch(NumberFormatException exception) {  
                System.out.println("error: " + exception.getMessage());
                throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Conversion Error", "Not a valid player"));  
            }catch(Exception e){
                System.out.println("error get as Object: " + e.getMessage());
            }
    } 
   return  fanlist; 
}  
 public String getAsString(FacesContext facesContext, UIComponent component, Object value) {  
        if (value == null || value.equals("")) {  
            return "";  
        } else {  
            return String.valueOf(((Fanlist) value).getId());  
        }  
    }   
public DAL getdAL() {
    return dAL;
}
public void setdAL(DAL dAL) {
    this.dAL = dAL;
}  
}
and here are the two ui components
this one works:
                <p:panelGrid columns="3">
                    <p:outputLabel for="fanlist" value="Subscription Opt-In List    " />
                    <p:autoComplete id="fanlist" dropdown="true"
                        value="#{campaignWizard.selectedList}"
                        completeMethod="#{campaignWizard.complete}" var="f"
                        itemLabel="#{f.name}" itemValue="#{f}" converter="#{fanlistConverter}" />
                    <p:commandLink value="Add List"
                        actionListener="#{campaignWizard.addFanList}" update=":formbox2"
                        ajax="false" />
                </p:panelGrid>
and this one does not work
        <p:selectManyMenu id="fanlist2" value="#{blast.selectedLists}"
                    var="fl" showCheckbox="true" converter="#{fanlistConverter}"
                    style="width:250px;height:100px">
                    <f:selectItems value="#{blast.fanlists}" var="fanl"
                        itemLabel="#{fanl.name}" itemValue="#{fanl}" />
                    <p:column>
                        Name: #{fl.name} 
                        </p:column>
                    <p:column>
                        Size: #{fl.name}
                        </p:column>
                </p:selectManyMenu>
@ManagedBean(name = "blast")
@ViewScoped
public class BlastBean implements Serializable {
@ManagedProperty(value="#{globalVars}")
private GlobalVars globalVars; 
@ManagedProperty(value="#{dAL}")
private DAL dAL;
@ManagedProperty(value="#{messaging}")
private Messaging messaging; 
private User u; 
private Blast blast;
private List<Fanlist> fanlists; 
private List<Fanlist> selectedLists;
private List<Fanlisttoparent> fltops = new ArrayList<Fanlisttoparent>();
    public  BlastBean(){
}
@PostConstruct
public void init(){
    fetchData();
}
public void fetchData(){
    u = globalVars.getUser();
    blast = new Blast();
    fanlists = dAL.query("FROM Fanlist where client.id ='" + globalVars.getUser().getClient().getId() + "'");
}   
...
public String sendBlast(){
    System.out.println("blast:" + blast.getMessage());
    dAL.upsert(blast);
    final List<String> phoneNumbers = new ArrayList<String>(); 
    List<Profile> profiles = new ArrayList<Profile>(); 
    for(Fanlist fl: selectedLists){
        Set<Fantolist> fantolist = fl.getFantolists();
        for(Fantolist ftol: fantolist){
            profiles.add(ftol.getFanprofile().getProfile());
        }
        for(Profile p: profiles){
            phoneNumbers.add("+1"+ p.getPhonenumber());
        }
    }
...
 
     
    