[jboss-user] [JBoss/Spring Integration] - Re: How to inject EJB into POJO

marius.bogoevici do-not-reply at jboss.com
Mon Jul 6 19:26:21 EDT 2009


Alen,

You can try using one of the standard Spring mechanisms:

- org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean or the jee namespace
- the @EJB annotation

There is a sample showing the usage of the EJB annotation in https://anonsvn.jboss.org/repos/jbossas/projects/spring-int/trunk/documentation/samples/horoscope/horoscope-war/src/main/java/org/jboss/tutorial/web/AppController.java - the root of the sample is

https://anonsvn.jboss.org/repos/jbossas/projects/spring-int/trunk/documentation/samples/horoscope/

The difference between this and your scenario is that yours is injecting EJBs in a Spring-Deployer bootstrapped application context, whereas the sample is injecting them in an ApplicationContext bootstrapped by the ContextLoaderListener, but this should work pretty much the same.

Give it a try and let me know if you encounter any issues.

Marius

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242081#4242081

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242081



More information about the jboss-user mailing list