-
1. Re: Richfaces + Spring seems to cause null @Autowired properties
mangelo123 Nov 4, 2010 9:25 AM (in response to mangelo123)I hope my experiences can help someone else that may encounter this problem. The issue was not RichFaces at all. With the help of Max Katz I figured out the issue. Mainly Max and his colleague did, but I'll share this with you.
I was using Spring beans for everything "# { }" in my JSF / RichFaces pages, even jsf converters. Max suggested that I remove all RichFaces libraries and see if it still happened and it did. Somehow, IceFaces fixes this problem, but upon every request, the converter instance is recreated and doesn't get its properties injected by Spring. This is what was causing my DAO to be null.
The only solution was to obtain the XmlWebApplicationContext from the ServletContext and get the DAO bean manually.
Not too bad, but I'd surely like to know how ICE addressed this issue. Maybe JSF 2 or beyond will fix this. I have not tested with JSF 2 so maybe it already is fixed.
MIke