Skip to content

Instantly share code, notes, and snippets.

@abhirockzz
Created January 14, 2015 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhirockzz/f9da989a2fd465c203ff to your computer and use it in GitHub Desktop.
Save abhirockzz/f9da989a2fd465c203ff to your computer and use it in GitHub Desktop.
public class EmbeddedEJBExample{
//inject an EJB available on the classpath
@EJB
MyLocalEJB local;
//use JNDI to talk to remotely deployed EJBs (via RMI)
EJBContainer container = EJBContainer.createEJBContainer();
Context context = container.getContext();
ARemoteEJB remote = (ARemoteEJB) context.lookup(<provide JNDI name here >)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment