I have 2 servers instances of Jboss 5, each of which is deployed with two EAR\'s. Say Client.Ear and Server.Ear. Server Ear expose some ejb\'s. I want to inject this to ClientE
@EJB
annotation can only be used if the applications are deployed in the same sever instance. @EJB
annotation won't work if you are trying to make cross server instance call or remote server call. So, in your case, annotation injection won't work.
So, what are the solutions ?
Option 1) Use old style programmatic JNDI look up
Option 2) Create managed bean as per CDI (Context Dependency Injection)
and configure all the JNDI properties there. And @inject
the managed bean
into your client.