Hello,

I am designing an app using Spring MVC + EJB3. Both Web and EJB modules get 
packaged into MyApp.ear and deployed into JBoss 4.0.5GA. Currently, to 
reference the stateless session bean (local if.) from one of the Controllers, I 
say:


  |     InitialContext ctx = new InitialContext();
  |     userService = (UserService) ctx.lookup(
  |                     "MyApp/UserServiceBean/local");
  | 

What I don't like, however, is that this method relies on 
"MyApp/UserServiceBean/local" string (What if, say, MyApp name changes?)

My question is: is there any better way (DI?) to reference the stateless 
session bean locally? I checked Spring's LocalStatelessSessionProxyFactoryBean 
but it appears that it applies to EJB 2.1 (Home IF's & stuff). Does @EJB or 
@Resource apply here?

Regards,
Leet Geezer

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994397
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to