How should ejb3 client reconnect to server after cluster is restarted in JBoss EAP?

Solution Unverified - Updated -

Issue

  • Given that RetryInterceptor is not available for ejb3, what is the correct, detailed, recommended way for ejb3 clients to detect a cluster shutdown / restart and then reconnect to that cluster.
  • Here is how we connect currently:

    env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
    env.put(Context.PROVIDER_URL, "server1:1100,server2:1100");
    env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
    context = new InitialContext(env);
    tempFacade = (ClientFacadeRemote) context.lookup("ejb/ClientFacadeBean/remote");
    
  • This is the test scenario:

         1.  Client gets EJB3 stub

         2.  Client continuously makes EJB3 call with stub
         3.  All cluster members are restarted, and come back up
         4.  Client continues makes another EJB3 call with the original stub and exceptions are thrown

  • Here is the stack trace even after the nodes are started:

    java.lang.RuntimeException: Unreachable?: Service unavailable.
         at org.jboss.aspects.remoting.ClusterChooserInterceptor.invoke(ClusterChooserInterceptor.java:189)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor.invoke(ClusteredIsLocalInterceptor.java:55)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.stateless.StatelessClusteredProxy.invoke(StatelessClusteredProxy.java:113)
    
  • What would be the complete list of unexpected exceptions that would prompt me to recreate the proxy and try again?

Environment

  • JBoss Enterprise Application Platform (EAP) 4.3
  • Clustered Stateless Session Bean (SLSB)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content