Mikal Henriksen
2013-05-30 09:35:11 UTC
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
[https://community.jboss.org/message/820321#820321]
Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
"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
[https://community.jboss.org/message/820321#820321]
Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]