Announcement Announcement Module
Collapse
No announcement yet.
No matching RMI stub problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No matching RMI stub problem

    I am having a problem where two separate EJBs are trying to invoke another EJB. The first EJB can invoke it with no problems, but when the second tries to, I get a "no matching RMI stub" error. Here's a summary of what's going on:

    1 stateless EJB called ServiceA
    2 stateless EJBs (EJB_A & EJB_B) that use ServiceA as a remote EJB.
    All EJBs are running in the same server, but each are deployed in different EARs.

    EJB_A initializes and then invokes ServiceA with no problems.

    EJB_B initializes and then when it tries to invoke ServiceA, this error message is generated: No matching RMI stub method found for: .....

    This problem can be fixed if ServiceA and EJB2 is restarted. EJB_B and EJB_A can now both successfully invoke ServiceA.

    The problem can be traced to org.springframework.remoting.rmi -> RmiClientInterceptorUtils.java:114

    Code:
    try {
    			if (method.getDeclaringClass().isInstance(stub)) {
    				// directly implemented
    				return method.invoke(stub, invocation.getArguments());
    			}
    			else {
    				// not directly implemented
    				Method stubMethod = stub.getClass().getMethod(method.getName(), method.getParameterTypes());
    				return stubMethod.invoke(stub, invocation.getArguments());
    			}
    		}
    When EJB_A invokes Service A, the if statement returns true. When EJB_B invokes Service A, the if statement returns false.

    Does anybody know why this happens?

    Thanks.
    Last edited by garrett0168; Feb 18th, 2010, 10:06 AM.
Working...
X