[jboss-user] [Spring Integration] - @Autowiring of beans from Spring applicationcontext

Stefan Rufer do-not-reply at jboss.com
Wed Mar 31 15:27:36 EDT 2010


Stefan Rufer [http://community.jboss.org/people/stefanrufer] replied to the discussion

"@Autowiring of beans from Spring applicationcontext"

To view the discussion, visit: http://community.jboss.org/message/535008#535008

--------------------------------------------------------------
I struggled with a similar problem and solved it with the following configuration in web.xml of the WAR file exposing my SOAP service:

     <!--
       The MessageDispatcherServlet is the entry point for all kinds of 
       SOAP requests. It implicitely loads an application context file
       /WEB-INF/<servletname>-servlet.xml if not configured otherwise. 
       However, as we want component scanning and everything
       we configure an own application context and context loader.
       
       Component scanning did not work if relying on the parent 
       Spring context (the parent context is the one loaded via 
       ContextLoaderListener). It only works if the default spring-ws
       context mechanism is reconfigured to use the application context
       in the classes directory. If done so, <import .../> and component 
          scanning works.
     -->
     <servlet>
          <servlet-name>trxservice</servlet-name>
          <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
          <init-param>
               <param-name>transformWsdlLocations</param-name>
               <param-value>true</param-value>
          </init-param>
          <init-param>
            <param-name>contextClass</param-name>
            <param-value>org.jboss.spring.vfs.context.VFSXmlWebApplicationContext</param-value>
          </init-param>
          <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:applicationContext-web.xml</param-value>
          </init-param>
     </servlet>

     <servlet-mapping>
          <servlet-name>trxservice</servlet-name>
          <url-pattern>/*</url-pattern>
     </servlet-mapping>


Hope this helps
Stefan

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/535008#535008]

Start a new discussion in Spring Integration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2082]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100331/d996ce8b/attachment.html 


More information about the jboss-user mailing list