5 Replies Latest reply on Feb 4, 2013 5:15 AM by sanssan Branched from an earlier discussion.

    Remote EJB invocation failure - client and server on same machine

    sanssan

      Hi,

       

      I do have strange issue now.

       

      Above example worked excellent with me when client is on another server.

       

      There are 3 instances JBoss 7.1.1 @ MyAPPSERVER_01 and 3 instances of JBoss 7.1.1.Final @ MyWEBSERVER_01.

       

      Above mentioned EJB call from JBossInstance_01 @ MyWEBSERVER_01 to JBossInstance_01 @ MyAPPSERVER_01, working good.

       

      But from JBossInstance_02 @ MyAPPSERVER_01 to JBossInstance_01 @ MyAPPSERVER_01

       

      Both EJB Client shares the same code....

       

      Client Lookup Code

      final Hashtable<String, Object> jndiProperties = new Hashtable<String, Object>();
      jndiProperties.put(Context.URL_PKG_PREFIXES, JNDINames.JBOSS_CLIENT_NAMING_PREFIX);
      InitialContext iContext = new InitialContext(jndiProperties);
      Object obj = iContext.lookup(name);
      

       

      jboss-ejb-client.xml

      <jboss-ejb-client xmlns="urn:jboss:ejb-client:1.0">
          <client-context>
              <ejb-receivers>
                  <remoting-ejb-receiver outbound-connection-ref="remote-ejb-connection"/>
              </ejb-receivers>
          </client-context>
      </jboss-ejb-client>
      

       

      standalone.xml

       

      <management>
      <security-realms>
          .............
          <security-realm name="ejb-security-realm">
          <server-identities>
              <secret value="dGVzdA=="/>
          </server-identities>
          </security-realm>
      </security-realms>
      .............
      </management>
      .............
      <profile>
      .............
      <subsystem xmlns="urn:jboss:domain:ejb3:1.2">
          <session-bean>
          <stateless>
              <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
          </stateless>
          <stateful default-access-timeout="5000" cache-ref="simple"/>
          <singleton default-access-timeout="5000"/>
          </session-bean>
          <mdb>
          <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
          <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
          </mdb>
          <pools>
          <bean-instance-pools>
              <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
              <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
          </bean-instance-pools>
          </pools>
          <caches>
          <cache name="simple" aliases="NoPassivationCache"/>
          <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/>
          </caches>
          <passivation-stores>
          <file-passivation-store name="file"/>
          </passivation-stores>
          <async thread-pool-name="default"/>
          <timer-service thread-pool-name="default">
          <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>
          </timer-service>
          <remote connector-ref="remoting-connector" thread-pool-name="default"/>
          <thread-pools>
          <thread-pool name="default">
              <max-threads count="10"/>
              <keepalive-time time="100" unit="milliseconds"/>
          </thread-pool>
          </thread-pools>
      </subsystem>
      .............
      <subsystem xmlns="urn:jboss:domain:remoting:1.1">
          <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
          <outbound-connections>
          <remote-outbound-connection name="remote-ejb-connection" outbound-socket-binding-ref="remote-ejb" username="ejbuser" security-realm="ejb-security-realm">
              <properties>
              <property name="SASL_POLICY_NOANONYMOUS" value="false"/>
              <property name="SSL_ENABLED" value="false"/>
              </properties>
          </remote-outbound-connection>
          </outbound-connections>
      </subsystem>
      .............
      </profile>
      .............
      <socket-binding-group name="standard-sockets" default-interface="any" port-offset="${jboss.socket.binding.port-offset:0}">
      <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:6992}"/>
      <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9988}"/>
      <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9446}"/>
      <socket-binding name="ajp" port="8012"/>
      <socket-binding name="https" port="8446"/>
      <socket-binding name="osgi-http" interface="management" port="8192"/>
      <socket-binding name="remoting" port="4453"/>
      <socket-binding name="txn-recovery-environment" port="4737"/>
      <socket-binding name="txn-status-manager" port="4727"/>
      <socket-binding name="messaging" port="5445"/>
      <socket-binding name="messaging-throughput" port="5455"/>
      <outbound-socket-binding name="mail-smtp">
          <remote-destination host="localhost" port="25"/>
      </outbound-socket-binding>
      <outbound-socket-binding name="remote-ejb">
          <remote-destination host="JBossInstance_01" port="4451"/>
      </outbound-socket-binding>
      </socket-binding-group>
      

       

      But, failing with error:

       

      java.lang.IllegalStateException: No EJB receiver available for handling [appName:quote,modulename:quote.jar,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@4a664d41
          at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)
          at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)
          at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
          at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
          at $Proxy16.isAlive(Unknown Source)
          at com.xyz.life.externalservice.services.AQuoteService.isServiceReachable(AQuoteService.java:492)
          at com.xyz.life.externalservice.common.component.manager.StartupService.start(StartupService.java:39)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:601)
          at org.jboss.as.service.AbstractService.invokeLifecycleMethod(AbstractService.java:52)
          at org.jboss.as.service.StartStopService.start(StartStopService.java:54)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
          at java.lang.Thread.run(Thread.java:722)
      

       

      This is the error for all following EJB Lookups!

       

      LOOKUP Name : ejb:global/quote/quote.jar/WebServiceQuoteFacadeEJB!com.ge.life.annuity.service.ejb.WebServiceQuoteFacade
      LOOKUP Obj : Proxy for remote EJB StatelessEJBLocator{appName='global', moduleName='quote', distinctName='quote.jar', beanName='WebServiceQuoteFacadeEJB', view='interface com.ge.life.annuity.service.ejb.WebServiceQuoteFacade'}
      TEST LOOKUP EXCEPTION : java.lang.IllegalStateException: No EJB receiver available for handling [appName:global,modulename:quote,distinctname:quote.jar] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@709dea70
      
      LOOKUP Name : ejb:app/quote.jar/WebServiceQuoteFacadeEJB!com.ge.life.annuity.service.ejb.WebServiceQuoteFacade
      LOOKUP Obj : Proxy for remote EJB StatelessEJBLocator{appName='app', moduleName='quote.jar', distinctName='', beanName='WebServiceQuoteFacadeEJB', view='interface com.ge.life.annuity.service.ejb.WebServiceQuoteFacade'}
      TEST LOOKUP EXCEPTION : java.lang.IllegalStateException: No EJB receiver available for handling [appName:app,modulename:quote.jar,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@f8a98d3
      
      LOOKUP Name : ejb:jboss/exported/quote/quote.jar/WebServiceQuoteFacadeEJB!com.ge.life.annuity.service.ejb.WebServiceQuoteFacade
      LOOKUP Obj : Proxy for remote EJB StatelessEJBLocator{appName='jboss', moduleName='exported', distinctName='quote', beanName='quote.jar/WebServiceQuoteFacadeEJB', view='interface com.ge.life.annuity.service.ejb.WebServiceQuoteFacade'}
      TEST LOOKUP EXCEPTION : java.lang.IllegalStateException: No EJB receiver available for handling [appName:jboss,modulename:exported,distinctname:quote] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@7a87029c
      
      LOOKUP Name : ejb:quote/quote.jar//QuoteFacadeEJB!com.ge.life.annuity.service.ejb.QuoteFacade
      LOOKUP Obj : Proxy for remote EJB StatelessEJBLocator{appName='quote', moduleName='quote.jar', distinctName='', beanName='QuoteFacadeEJB', view='interface com.ge.life.annuity.service.ejb.QuoteFacade'}
      TEST LOOKUP EXCEPTION : java.lang.IllegalStateException: No EJB receiver available for handling [appName:quote,modulename:quote.jar,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@7601356
      
      LOOKUP Name : ejb:quote/quote.jar//WebServiceQuoteFacadeEJB!com.ge.life.annuity.service.ejb.WebServiceQuoteFacade
      LOOKUP Obj : Proxy for remote EJB StatelessEJBLocator{appName='quote', moduleName='quote.jar', distinctName='', beanName='WebServiceQuoteFacadeEJB', view='interface com.ge.life.annuity.service.ejb.WebServiceQuoteFacade'}
      TEST LOOKUP EXCEPTION : java.lang.IllegalStateException: No EJB receiver available for handling [appName:quote,modulename:quote.jar,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@349576e2
      

       

      But, same lookup working well from WEB Server. Why it is not working from APP Server?

       

      Only differnce between

      JBossInstance_01 @ MyWEBSERVER_01 (EJB Client call working) and JBossInstance_02 @ MyAPPSERVER_01 (EJB Client call not working) is MDB configuration is added to JBossInstance_02 @ MyAPPSERVER_01 server where JBossInstance_01 @ MyWEBSERVER_01 is not having MDB configuration.

       

      Would it affect the client?

       

      In

       

      <outbound-socket-binding name="remote-ejb">
          <remote-destination host="JBossInstance_01" port="4451"/>
      </outbound-socket-binding>
      

       

      I tried, localhost, HOSTNAME, IP Address, 127.0.0.1 (IP address for localhost).... But, all fails with same error.