[jboss-user] [JNDI and Naming] - Use plain @EJB for remote EJB lookup?

Mikal Henriksen do-not-reply at jboss.com
Thu May 30 05:35:11 EDT 2013

Mikal Henriksen [https://community.jboss.org/people/stylpe] created the discussion

"Use plain @EJB for remote EJB lookup?"

To view the discussion, visit: https://community.jboss.org/message/820321#820321

I've been using the guide at  https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+server+instance https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+server+instance to make a standalone war that uses beans that are deployed in an ear running on a separate AS. I got it working by using an explicit lookup name in the @EJB annotation, like this:

@EJB(lookup = "ejb:earname/modulename/BeanClass!fully.qualified.RemoteInterface")
private RemoteInterface bean;

Writing this for all the remote EJBs is getting tedious, and refactoring with it is even worse. Is there a way to tell the default context which app name and module name to use, so that I can use plain @EJB annotations without parameters?

I know I could create a helper class and use InitialContext.lookup, or alias each bean I plan to use in xml (I forget which one), but I want to be sure there isn't an easier, cleaner way to do this.

Reply to this message by going to Community

Start a new discussion in JNDI and Naming at Community

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

More information about the jboss-user mailing list