0 Replies Latest reply on Aug 15, 2013 2:27 PM by Wes Strickland

    Trouble with JNDI aliases in standalone-ha.xml

    Wes Strickland Newbie

      When the server starts up it prints out the following binding:

       

      11:13:44,237 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named CountryCodeService in deployment unit subdeployment "MT_MAAS_CountryCodeBeans.jar" of deployment "MT_MAAS_OpsEar.ear" are as follows:

       

          java:global/MT_MAAS_OpsEar/MT_MAAS_CountryCodeBeans/CountryCodeService!com.gdais.maas.ejb.CountryCodeServiceRemote

          java:app/MT_MAAS_CountryCodeBeans/CountryCodeService!com.gdais.maas.ejb.CountryCodeServiceRemote

          java:module/CountryCodeService!com.gdais.maas.ejb.CountryCodeServiceRemote

          java:jboss/exported/MT_MAAS_OpsEar/MT_MAAS_CountryCodeBeans/CountryCodeService!com.gdais.maas.ejb.CountryCodeServiceRemote

          java:global/MT_MAAS_OpsEar/MT_MAAS_CountryCodeBeans/CountryCodeService

          java:app/MT_MAAS_CountryCodeBeans/CountryCodeService

          java:module/CountryCodeService

       

      In our client code, we do the following which works great:

       

      // Create the proxy
      StatelessEJBLocator<CountryCodeServiceRemote> locator = new StatelessEJBLocator<>(CountryCodeServiceRemote.class, "MT_MAAS_OpsEar",
          "MT_MAAS_CountryCodeBeans", "CountryCodeService", "");

       

      ccOps = EJBClient.createProxy(locator);

       

      I attempted to create an alias for this in my standalone-ha.xml like this:

       

      <subsystem xmlns="urn:jboss:domain:naming:1.2">

                  <bindings>

                    <lookup name="java:jboss/exported/OpsEar/CountryCodeBeans/CountryCodeService" lookup="java:jboss/exported/MT_MAAS_OpsEar/MT_MAAS_CountryCodeBeans/CountryCodeService"/>

                  </bindings>

      </subsystem>

       

      And then change the client code to:

       

      StatelessEJBLocator<CountryCodeServiceRemote> locator = new StatelessEJBLocator<>(CountryCodeServiceRemote.class, "OpsEar",
          "CountryCodeBeans", "CountryCodeService", "");

       

      ccOps = EJBClient.createProxy(locator);

       

      But when I run the client, I get back an error that there is no EJB receiver available:

       

      java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:OpsEar, moduleName:CountryCodeBeans, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@1527c4f

       

      Any help would be appreciated!

       

      Thanks!

      -Wes