JBoss Community

Richfaces + Spring seems to cause null @Autowired properties

created by Michael Angelo in Spring Integration - View the full discussion

I am in a bind in a big way because this problem seems so obscure. I began developing an application using Spring and IceFaces a few weeks ago. I wasn't having any of the issues that I am over the last few days trying to convert to RichFaces.

 

Of course all of the backing Spring bean classes were moved right over. The proper adjustments were made in the web.xml file.

 

Upon running may application I see a blank form with all of the drop down lists populated as expected. I put a break point in a custom converter for one of the drop downs. I put this breakpoint on the getAsString method. This method does not involved the @Autowired  property, but I can see the Spring correctly injected its value from within the debugger. All is good!!

 

On the subsequent view I retrieve a row from the database. There are quite a few @Autowired properties that have been injected just fine. In the debugger I now have a breakpoint on the getAsObject method. Once the debugger stops there my @Autowired property that is nedded in this method is null.

 

I cannot for the life of me see how moving to Richfaces could cause such a disaster, but I can't find anything thing else and am at my wits end!! I desperately want to move to RichFaces, but am in one hell of a bind!!!!

 

Please help!!!

 

Here is the custom converter bean:

 

public

 

class DocumentTypeConverter implements Converter {

 

 

@Autowired

DDocumentTypeDAO dao;

 

 

@Override

 

public Object getAsObject(FacesContext context, UIComponent ui, String id) {

 

DDocumentType docType =

dao.findById(id);

 

return docType;

}

 

 

@Override

 

public String getAsString(FacesContext context, UIComponent ui, Object obj) {

 

 

if (obj == null) {

 

return "";

}

 

DDocumentType dt = (DDocumentType)obj;

 

return dt.getDctypeD();

}

 

 

public DDocumentTypeDAO getDao() {

 

return dao;

}

 

 

public void setDao(DDocumentTypeDAO dao) {

 

this.dao = dao;

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reply to this message by going to Community

Start a new discussion in Spring Integration at Community