[jboss-user] [Snowdrop] - Re: JBoss 5, Spring 3 Autowiring beans

Marius Bogoevici do-not-reply at jboss.com
Wed May 18 10:40:21 EDT 2011


Marius Bogoevici [http://community.jboss.org/people/marius.bogoevici] created the discussion

"Re: JBoss 5, Spring 3 Autowiring beans"

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

--------------------------------------------------------------
Hm, I tried to reproduce the issue myself using the Spring deployer (on which the example seems to be initially based), but I see a different issue: the Spring lifecycle interceptor is applied correctly and tries to inject the bean, but because the managed bean is deployed before the Spring application context is bootstrapped, the deployment fails (the lifecycle interceptor cannot find the object in JNDI). One solution is to change the ordering of the deployments.

I suppose that switching to @Autowired (as you did for the class) would help, but you would also need to set up a ClasspathSingletonBeanFactoryLocator - see  http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ejb.html#ejb-implementation http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ejb.html#ejb-implementation (the EJB2 section explains how to set it up, and the EJB3 section explains how to use it for EJB3).
--------------------------------------------------------------

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

Start a new discussion in Snowdrop 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/20110518/9540226a/attachment.html 


More information about the jboss-user mailing list