How the properties which are given to create the initialContext look like?
How the lookup jndiName look like?
It is not an guarantee that the proxy target is available if the lookup succeeds.
Since it's a Server to Server EJB call, we are following all the steps to create remote outbound connections in standalone-full-ha.xml
and packaging jboss-ejb-client.xml in client EAR.
As I explain in the sample code, first EJB method call succeeds so the proxy target is available initially.
however during the execution the target could be undeployed, but there are same EJB deployed in other nodes in the cluster
so we want to recover this and make a new JNDI lookup to other available proxy target
Although we thought it should have happened automatically without need of explicitly doing a lookup again.
Also since it's a stateless EJB, if I invoke multiple methods (hundred of times) will all be invoked on same target proxy or
it will be load balanced in the cluster?
And if it's not load balanced, will the server use the SLSB pool to allocate actual ejb object eventually
resulting in different beans used for different method invocation though from the same server's SLSB pool?
First, if you want to have cluster features yoou need to do a bit.
If you need initial two server for failover you need to have 2 remote outbound configurations!
If you add such config you will have cluster loadbalancing and failover
As it is a SLSB the target might not the same, there is a pool (server local) which hold beans if you invoke in parallel and need more instances.
Also I've raised a JIRA to simplify the administration in case of a cluster.
Thanks for the help, yes, I see the fail-over, load balacing happening correctly after adding jboss-ejb-client.xml in WEB-INF folder, this got missed out as we were trying to lookup EJB from Web module for the first time.