I have two Tomcat 6 instances which both call EJBs on a remote JBoss 5 server.
With the same client code deployed on both Tomcats, I get a NullPointerException
from the application server when one invokes an EJB method, while on the other it works fine.
Looking through the code with the debugger, it seems like the hash code of the method being invoked is different between the two calls, even though I assume it should be the same. Because the hash code is different, the remote method isn't being found in org.jboss.ejb3.service.ServiceContainer
.
What could be leading to the hash code being different between the two invocations? For information, the working Tomcat is on the same machine as the JBoss server, while the failing Tomcat has to connect to JBoss across the network. Both Tomcats' connection configurations are the same.
The solution was the presence of jboss-aspect-jdk50-client_4.2.2.jar
in Tomcat's lib directory - removing this file allowed the application to work correctly.
What I still don't understand is why this worked on the local Tomcat instance but not on the remote. I assume that either the classloading order was somehow different, or, more likely, the fact that communication was remote resulted in a different strategy being used.
I'm keeping the question open for a bit just in case someone can provide an explanation to this last bit.