<!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;">
    @Autowiring of beans from Spring applicationcontext
</h3>
<span style="margin-bottom: 10px;">
    reply from <a href="http://community.jboss.org/people/MartinBorgman">Martin Borgman</a> in <i>Spring Integration</i> - <a href="http://community.jboss.org/message/536772#536772">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi Johannes,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Your autowiringtest.zip helped to find out what your problem really is.</p><p>My first question is why you replaced JBossWS Native, the one that is installed by default, with the JBoss Metro implementation? There is no real need to do this. I'm sure it should work, but at this point I think you're adding complexity you don't need.</p><p>The only real issue I found with the webservice is that you repleced org.springframework.web.context.support.SpringBeanAutowiringSupport by org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor. As the class name SpringBeanAutowiringInterceptor implies, it is intended to work in an EJB context, not in a web context.</p><p>Other than some typos here and there the webservice works on a standard JBoss 5.1.0.GA with the three snowdrop jars copied to&#160; ${JBOSS_HOME}/server/default/lib.</p><p>I've include the zip with my fixes.</p><p>The deployment now looks like this:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><div id="_mcePaste">14:19:41,197 INFO&#160; [DefaultEndpointRegistry] register: jboss.ws:context=autowiring_war,endpoint=autowiring-webservice</div><div id="_mcePaste">14:19:41,203 INFO&#160; [WebMetaDataModifierImpl] Ignore servlet: my.pkg.AutowiringServlet</div><div id="_mcePaste">14:19:41,257 INFO&#160; [TomcatDeployment] deploy, ctxPath=/autowiring_war</div><div id="_mcePaste">14:19:41,326 INFO&#160; [[/autowiring_war]] Initializing Spring root WebApplicationContext</div><div id="_mcePaste">14:19:41,326 INFO&#160; [ContextLoader] Root WebApplicationContext: initialization started</div><div id="_mcePaste">14:19:41,364 INFO&#160; [ClassPathXmlApplicationContext] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@253fd92e: display name [org.springframework.context.support.ClassPathXmlApplicationContext@253fd92e]; startup date [Sun Apr 11 14:19:41 CEST 2010]; root of context hierarchy</div><div id="_mcePaste">14:19:41,438 INFO&#160; [XmlBeanDefinitionReader] Loading XML bean definitions from URL [vfszip:/Users/martinborgman/jboss-5.1.0.GA/server/default/deploy/autowiring_ear-1.0-SNAPSHOT.ear/beanRefContext.xml]</div><div id="_mcePaste">14:19:41,495 INFO&#160; [ClassPathXmlApplicationContext] Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@253fd92e]: org.springframework.beans.factory.support.DefaultListableBeanFactory@c0e0960</div><div id="_mcePaste">14:19:41,514 INFO&#160; [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@c0e0960: defining beans [ear.context]; root of factory hierarchy</div><div id="_mcePaste">14:19:41,571 INFO&#160; [VFSClassPathXmlApplicationContext] Refreshing org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext@6651b294: display name [org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext@6651b294]; startup date [Sun Apr 11 14:19:41 CEST 2010]; root of context hierarchy</div><div id="_mcePaste">14:19:41,573 INFO&#160; [XmlBeanDefinitionReader] Loading XML bean definitions from ZipEntryHandler@377437762[path=autowiring_ear-1.0-SNAPSHOT.ear/context.xml context=file:/Users/martinborgman/jboss-5.1.0.GA/server/default/deploy/ real=file:/Users/martinborgman/jboss-5.1.0.GA/server/default/deploy/autowiring_ear-1.0-SNAPSHOT.ear/context.xml]</div><div id="_mcePaste">14:19:41,588 INFO&#160; [VFSClassPathXmlApplicationContext] Bean factory for application context [org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext@6651b294]: org.springframework.beans.factory.support.DefaultListableBeanFactory@3f3499ef</div><div id="_mcePaste">14:19:41,590 INFO&#160; [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@3f3499ef: defining beans [myService]; root of factory hierarchy</div><div id="_mcePaste">14:19:41,602 INFO&#160; [VFSXmlWebApplicationContext] Refreshing org.jboss.spring.vfs.context.VFSXmlWebApplicationContext@214ef1ea: display name [Root WebApplicationContext]; startup date [Sun Apr 11 14:19:41 CEST 2010]; parent: ear.context</div><div id="_mcePaste">14:19:41,603 INFO&#160; [XmlBeanDefinitionReader] Loading XML bean definitions from FileHandler@529563278[path=WEB-INF/classes/applicationContext.xml context=file:/Users/martinborgman/jboss-5.1.0.GA/server/default/tmp/a002s-x8x9a6-g7vtmr79-1-g7vtnzfi-9r/autowiring_war-1.0-SNAPSHOT.war/ real=file:/Users/martinborgman/jboss-5.1.0.GA/server/default/tmp/a002s-x8x9a6-g7vtmr79-1-g7vtnzfi-9r/autowiring_war-1.0-SNAPSHOT.war/WEB-INF/classes/applicationContext.xml]</div><div id="_mcePaste">14:19:41,615 INFO&#160; [VFSXmlWebApplicationContext] Bean factory for application context [org.jboss.spring.vfs.context.VFSXmlWebApplicationContext@214ef1ea]: org.springframework.beans.factory.support.DefaultListableBeanFactory@165fb09d</div><div id="_mcePaste">14:19:41,628 INFO&#160; [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@165fb09d: defining beans []; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@3f3499ef</div><div id="_mcePaste">14:19:41,628 INFO&#160; [ContextLoader] Root WebApplicationContext: initialization completed in 302 ms</div><div id="_mcePaste">14:19:43,595 INFO&#160; [WSDLFilePublisher] WSDL published to: file:/Users/martinborgman/jboss-5.1.0.GA/server/default/data/wsdl/autowiring_ear-1.0-SNAPSHOT.ear/autowiring_war-1.0-SNAPSHOT.war/AutowiringWebService4718254481898707626.wsdl</div><div> </div><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Kind regards,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Martin</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/536772#536772">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>