where is the lookup code located? application client (with a main method), in a servlet/jsp, etc.?
The lookup code is in a Stateless Session Bean in the JBoss Master. So, in my diagram, it's in the "middle" section.
This Statless Session Bean has to look up the Stateless Session Bean in one of the remote nodes and do a call to that.
The sequence is thus:
1. Client (eg. command line) looks up Master Stateless Session Bean and calls it.
2. Master Stateless Session Bean looks up Node Stateless Session Bean (which can be on the local JBoss, but usually in another Node JBoss) and calls that.
The lookup code in 2. always returns a local instance of Node Stateless Session Bean even though the lookup specified a remote Node JBoss's IP address and I wanted a remote proxy to the Node Stateless Session Bean on the remote Node JBoss.
just to make sure, when you deploy the ear to the Master Node it is also deployed to other Nodes right?
i wouldn't be suprised if when the remote lookup fails the local context is then checked.
The deployments seems ok as far as I can acertain. When I undeploy the Node ear from the Master jboss, the lookup to the remote Node works perfectly.
If there was a problem with it not getting the remote instance, it should have produced an error in this case. But it gets the remote instance and executes without problem.
Interesting thing is, starting Master JBoss without the node causes getting the remote Node. Hot deploying Node into master, still get remote node. Restart JBoss and I get the local Node again, not master. It's as if once I get a context, it doesn't get re-created, even though I did acquire a new context. Is it possible that the Context is a Singleton and that subsequent retrieval of contexts always return the same instance, regardless of the parameters I pass when asking for the context?
I have created a test project that recreates this behaviour. If anyone is interested, I can send it or upload it somewhere.
Is there any solution or workaround available regarding this problem?
Nearly one year later, I'm facing the same issue with JBoss 4.2.3.GA.
Sadly I have never managed to get an anwer to this problem. We have resorted to changing our whole layout of servers and then get by by not deploying the relevant code on the "master" node. It means that those can only be accessed at the remote nodes and the resolution of those reserver work correctly.
I hope you have more luck in finding a solution and would be grateful if you can post it here should you get one!
Have you tried
Worked for me in a similar situation. This property forces the connection to only connect to the specified server and no one else (including self). It does have clustering implications you need to examine though.