<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Richfaces + Spring seems to cause null @Autowired properties
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/mangelo123">Michael Angelo</a> in <i>Spring Integration</i> - <a href="http://community.jboss.org/message/569373#569373">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Of course all of the backing Spring bean classes were moved right over. The proper adjustments were made in the web.xml file.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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&#160; property, but I can see the Spring correctly injected its value from within the debugger. All is good!!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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!!!!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Please help!!!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here is the custom converter bean:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><p><strong style=": ; color: #7f0055; font-size: 10pt; "><p align="left">public</p><span style="color: #7f0055; font-size: 10pt; "><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><strong><span style="color: #7f0055; font-size: 10pt; ">class</span><span style="font-size: 10pt;"> DocumentTypeConverter </span><strong><span style="color: #7f0055; font-size: 10pt; ">implements</span><span style="font-size: 10pt;"> Converter {</span><span style="font-size: 10pt;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><span style="color: #646464; font-size: 10pt; ">@Autowired</span><span style="font-size: 10pt;"><p align="left">DDocumentTypeDAO <span style="color: #0000c0; font-size: 10pt; ">dao</span><span style="font-size: 10pt;">;</span><span style="font-size: 10pt;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><span style="color: #646464; font-size: 10pt; ">@Override</span><span style="font-size: 10pt;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><strong><span style="color: #7f0055; font-size: 10pt; ">public</span><span style="font-size: 10pt;"> Object getAsObject(FacesContext context, UIComponent ui, String id) {</span><span style="font-size: 10pt;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left">DDocumentType docType =</p><p align="left"><span style="color: #0000c0; font-size: 10pt; ">dao</span><span style="font-size: 10pt;">.findById(id);</span><span style="font-size: 10pt;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><strong><span style="color: #7f0055; font-size: 10pt; ">return</span><span style="font-size: 10pt;"> docType;</span><span style="font-size: 10pt;"><p align="left">}</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><span style="color: #646464; font-size: 10pt; ">@Override</span><span style="font-size: 10pt;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><strong><span style="color: #7f0055; font-size: 10pt; ">public</span><span style="font-size: 10pt;"> String getAsString(FacesContext context, UIComponent ui, Object obj) {</span><span style="font-size: 10pt;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><strong><span style="color: #7f0055; font-size: 10pt; ">if</span><span style="font-size: 10pt;"> (obj == </span><strong><span style="color: #7f0055; font-size: 10pt; ">null</span><span style="font-size: 10pt;">) {</span><span style="font-size: 10pt;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><strong><span style="color: #7f0055; font-size: 10pt; ">return</span><span style="font-size: 10pt;"> </span><span style="color: #2a00ff; font-size: 10pt; ">""</span><span style="font-size: 10pt;">;</span><span style="font-size: 10pt;"><p align="left">}</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left">DDocumentType dt = (DDocumentType)obj;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><strong><span style="color: #7f0055; font-size: 10pt; ">return</span><span style="font-size: 10pt;"> dt.getDctypeD();</span><span style="font-size: 10pt;"><p align="left">}</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><strong><span style="color: #7f0055; font-size: 10pt; ">public</span><span style="font-size: 10pt;"> DDocumentTypeDAO getDao() {</span><span style="font-size: 10pt;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><strong><span style="color: #7f0055; font-size: 10pt; ">return</span><span style="font-size: 10pt;"> </span><span style="color: #0000c0; font-size: 10pt; ">dao</span><span style="font-size: 10pt;">;</span><span style="font-size: 10pt;"><p align="left">}</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><strong><span style="color: #7f0055; font-size: 10pt; ">public</span><span style="font-size: 10pt;"> </span><strong><span style="color: #7f0055; font-size: 10pt; ">void</span><span style="font-size: 10pt;"> setDao(DDocumentTypeDAO dao) {</span><span style="font-size: 10pt;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"><strong><span style="color: #7f0055; font-size: 10pt; ">this</span><span style="font-size: 10pt;">.</span><span style="color: #0000c0; font-size: 10pt; ">dao</span><span style="font-size: 10pt;"> = dao;</span><span style="font-size: 10pt;"><p>}</p></span></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></span></strong></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></span></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></span></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></span></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></span></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></span></strong></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></span></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span></strong></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></span></strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/569373#569373">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Spring Integration at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2082">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>