Can anyone help with this?
Can you restate your question? You seem to have two problems (LB and service unavailable).
As for the first, yes, it is implemented this way.
>> Please restate...
Load balancing will only work if I cache the EJB reference between calls. For JSP, this means putting the reference in the HttpSession.
I have to cache the EJB reference itself, not just the Home interface.
My JBoss.xml appears to be set up correctly, since Load Balancing does work if I cache the stub.
As far as my "Service Unnavailable" comment, I brought that up as a negative of caching the EJB - if someone bounces the JBoss server the stub is invalid.
I've attached my JBoss.xml.
Thanks for any help,
I am running with JBoss 3.2.1 using a stand alone application that just caches the home interfaces and I am having no problems with load balancing.
Is your web application being hosted by JBoss?
Is their any chance that you are getting a reference to your home interface from the local jndi instead of the HA-JNDI?
Are you *sure* your bean is clustered?
Ok, I've just tried with a SLSB on JBoss 3.2.1 with your exact jboss.xml configuratino and it works, there is no need to cache the proxy to load-balance calls.
Can you check your environnement? You seem to have the old 3.0 behaviour.
I think I found it. Everything was set up correctly except I had a literal listing of server HA-JNDI nodes on the InitialContext.
NOTE: My client lives on one of the JBoss nodes. I was using:
and I should have had :
I honestly thought I was using the second example.
The reason I found it was because I took down machine1 and noticed a lag on EJB calls when I was not caching stubs. It must have been trying to contact the first list member!
Sacha, does this sound like the right explaination for what I'm seeing? Everything works as advertised now.
I appreciate your help.
what is the difference between machine1, machine2 and localhost? Where are the servers? It should have worked, strange.