<!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">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;">
    JBoss 5.1.0 and Multiple EARs and EJBs using the SpringBeanAutowiringInterceptor issue
</h3>
<span style="margin-bottom: 10px;">
    reply from <a href="http://community.jboss.org/people/kyle.bober">Kyle Bober</a> in <i>Spring Integration</i> - <a href="http://community.jboss.org/message/547577#547577">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Okay I have found a solution to my issue. I am not sure if this is the best way of handling this but it works for now and I have yet to run into any issue.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>We overrode the getBeanFactoryLocator method in the SpringBeanAutowiringInterceptor class. We then used the new Interceptor in our EJB</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@Interceptors(AnotherSpringBeanAutowiringInterceptor.class)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>package com.somepackage;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import org.springframework.beans.factory.access.BeanFactoryLocator;<br/>import org.springframework.context.access.ContextSingletonBeanFactoryLocator;<br/>import org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor;</p><p><br/>public class AnotherSpringBeanAutowiringInterceptor extends&#160;&#160;&#160; SpringBeanAutowiringInterceptor {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; private static final String DEFAULT_RESOURCE_LOCATION = "classpath*:anotherBeanRefContext.xml";<br/>&#160;&#160;&#160; <br/>&#160;&#160;&#160; /**<br/>&#160;&#160;&#160;&#160; * Determine the BeanFactoryLocator to obtain the BeanFactoryReference from.<br/>&#160;&#160;&#160;&#160; * &lt;p&gt;The default implementation exposes Spring's default<br/>&#160;&#160;&#160;&#160; * {@link ContextSingletonBeanFactoryLocator}.<br/>&#160;&#160;&#160;&#160; * @param target the target bean to autowire<br/>&#160;&#160;&#160;&#160; * @return the BeanFactoryLocator to use (never &lt;code&gt;null&lt;/code&gt;)<br/>&#160;&#160;&#160;&#160; * @see org.springframework.context.access.ContextSingletonBeanFactoryLocator#getInstance()<br/>&#160;&#160;&#160;&#160; */<br/>&#160;&#160;&#160; protected BeanFactoryLocator getBeanFactoryLocator(Object target) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; return ContextSingletonBeanFactoryLocator.getInstance(DEFAULT_RESOURCE_LOCATION);<br/>&#160;&#160;&#160; }&#160;&#160;&#160; <br/>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This worked for our multiple EARs which each contained a diffrent beanRefContext.xml. We needed to make the names beanRefContext.xml file unique per EAR and then override the SpringBeanAutowiringInterceptor getBeanFactoryLocator method. We also changed the DEFAULT_RESOURCE_LOCATION string to reference out EARs specific beanRefContext.xml file. If anyone sees an issue with this please let me know as to what side affects we may run into. For now this has been running just fine.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks for everyones help and insight into this issue.</p><p>-Kyle Bober</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/547577#547577">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>