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

Martin Borgman do-not-reply at jboss.com
Sun Apr 11 10:27:36 EDT 2010


Martin Borgman [http://community.jboss.org/people/MartinBorgman] replied to the discussion

"@Autowiring of beans from Spring applicationcontext"

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

--------------------------------------------------------------
Hi Johannes,

Your autowiringtest.zip helped to find out what your problem really is.
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.
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.
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  ${JBOSS_HOME}/server/default/lib.
I've include the zip with my fixes.
The deployment now looks like this:

14:19:41,197 INFO  [DefaultEndpointRegistry] register: jboss.ws:context=autowiring_war,endpoint=autowiring-webservice
14:19:41,203 INFO  [WebMetaDataModifierImpl] Ignore servlet: my.pkg.AutowiringServlet
14:19:41,257 INFO  [TomcatDeployment] deploy, ctxPath=/autowiring_war
14:19:41,326 INFO  [[/autowiring_war]] Initializing Spring root WebApplicationContext
14:19:41,326 INFO  [ContextLoader] Root WebApplicationContext: initialization started
14:19:41,364 INFO  [ClassPathXmlApplicationContext] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext at 253fd92e: display name [org.springframework.context.support.ClassPathXmlApplicationContext at 253fd92e]; startup date [Sun Apr 11 14:19:41 CEST 2010]; root of context hierarchy
14:19:41,438 INFO  [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]
14:19:41,495 INFO  [ClassPathXmlApplicationContext] Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext at 253fd92e]: org.springframework.beans.factory.support.DefaultListableBeanFactory at c0e0960
14:19:41,514 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory at c0e0960: defining beans [ear.context]; root of factory hierarchy
14:19:41,571 INFO  [VFSClassPathXmlApplicationContext] Refreshing org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext at 6651b294: display name [org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext at 6651b294]; startup date [Sun Apr 11 14:19:41 CEST 2010]; root of context hierarchy
14:19:41,573 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from ZipEntryHandler at 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]
14:19:41,588 INFO  [VFSClassPathXmlApplicationContext] Bean factory for application context [org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext at 6651b294]: org.springframework.beans.factory.support.DefaultListableBeanFactory at 3f3499ef
14:19:41,590 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory at 3f3499ef: defining beans [myService]; root of factory hierarchy
14:19:41,602 INFO  [VFSXmlWebApplicationContext] Refreshing org.jboss.spring.vfs.context.VFSXmlWebApplicationContext at 214ef1ea: display name [Root WebApplicationContext]; startup date [Sun Apr 11 14:19:41 CEST 2010]; parent: ear.context
14:19:41,603 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from FileHandler at 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]
14:19:41,615 INFO  [VFSXmlWebApplicationContext] Bean factory for application context [org.jboss.spring.vfs.context.VFSXmlWebApplicationContext at 214ef1ea]: org.springframework.beans.factory.support.DefaultListableBeanFactory at 165fb09d
14:19:41,628 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory at 165fb09d: defining beans []; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory at 3f3499ef
14:19:41,628 INFO  [ContextLoader] Root WebApplicationContext: initialization completed in 302 ms
14:19:43,595 INFO  [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
 

Kind regards,

Martin

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

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

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/20100411/8db9f7b7/attachment.html 


More information about the jboss-user mailing list