2 Replies Latest reply on May 30, 2012 7:28 AM by javamutu

    No EJB receiver available for handling in JBoss AS 7

    javamutu Newbie

      When I loockup the EBJ Remote by JNDI, I get the the following exception.

      I don't what is missing, I used the different JNDI name. But, I will still the following error.

      Please, reivew and help me!

       

      INFO: Connection default will not be available in EJB client context org.jboss.ejb.client.EJBClientContext@60420f

      Exception in thread "main" java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:YomaBankService,distinctname:]

       

      My EJB Module and Configuration is :

       

      In jboss-ebj-jndi.properties,

       

      endpoint.name=client-endpoint

      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

       

      remote.connections=default

       

      remote.connection.default.host=10.20.30.40

      remote.connection.default.port = 4447

      remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

       

      remote.connection.default.username=admin

      remote.connection.default.password=admin

       

      Libray is :

       

      jboss-ejb-api_3.1_spec-1.0.1.Final.jar

      jboss-ejb-client-1.0.0.Beta11.jar

      jboss-logging-3.1.0.CR2.jar

      jboss-marshalling-1.3.4.GA.jar

      jboss-marshalling-river-1.3.4.GA.jar

      jboss-remoting-3.2.0.CR6-darranl-1.jar

      jboss-sasl-1.0.0.Beta9.jar

      jboss-transaction-api_1.1_spec-1.0.0.Final.jar

      xnio-api-3.0.0.CR5.jar

      xnio-nio-3.0.0.CR5.jar

       

      Reference :

       


      java:global/YomaBankService/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceLocal

      java:app/YomaBankService/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceLocal

      java:module/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceLocal

      java:global/YomaBankService/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceRemote

      java:app/YomaBankService/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceRemote

      java:module/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceRemote

      java:jboss/exported/YomaBankService/YomaBankService!com.mutu.gbt.ejb.interfaces.IYomaBankServiceRemote

       

      My EJB Client is :

       

      package com.mutu.gbt.ejb.client;

       

      import java.util.Properties;

       

      import javax.naming.Context;

      import javax.naming.InitialContext;

      import javax.naming.NamingException;

       

      import com.mutu.gbt.ejb.Bank;

      import com.mutu.gbt.ejb.Customer;

      import com.mutu.gbt.ejb.YomaBankService;

      import com.mutu.gbt.ejb.interfaces.IYomaBankServiceRemote;

      import com.mutu.gbt.interfaces.IYomaBankService;

       

      public class YomaBankServiceClient2 {

          public Context getInitialContext() throws NamingException {

              Properties jndiProperties = new Properties();

              jndiProperties.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

              return new InitialContext(jndiProperties);

          }

       

          private IYomaBankService getYomaBankService() {

              IYomaBankService result = null;

              try {

                  String applicationName = "";

                  String moduleName = "YomaBankService";

                  String distinctName = "";

                  String beanName = YomaBankService.class.getSimpleName();

                  System.out.println("BeanName \t:" + beanName);

                  String viewClassName = IYomaBankServiceRemote.class.getName();

                  System.out.println("ViewClassName \t:" + beanName);

                  Context context = getInitialContext();

                  IYomaBankServiceRemote yomaBankServiceRemote = (IYomaBankServiceRemote)context.lookup("ejb:" + applicationName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName);

                  result = (IYomaBankService)yomaBankServiceRemote;

              } catch(NamingException e) {

                  e.printStackTrace();

              }

              return result;

          }

       

          public void runtTest() {

              IYomaBankService yomaBankService = getYomaBankService();

              Customer from = new Customer("zawthanoo", "Zaw Than Oo");

              Customer to = new Customer("test", "Test User");

              yomaBankService.transferCash(from, to, 5000, Bank.KBZ);

          }

       

          public static void main(String[] args) {

              YomaBankServiceClient2 client = new YomaBankServiceClient2();

              client.runtTest();

          }

      }

        • 1. Re: No EJB receiver available for handling in JBoss AS 7
          bate Newbie

          Last lime i got this error was due to the fact that, the jar i was using were older than those of the JBoss Server i was deploying/running the application on.

          Please verfify that u are using the same version jar in your classpath as those on the server your running your application on

          • 2. Re: No EJB receiver available for handling in JBoss AS 7
            javamutu Newbie

            Thank for your replay!

             

            I remove the jar files from the ClassPath in EJB Project. I changed the configuration as follow in jboss-ejb-jndi.properties.

             

            remote.connection.default.host=10.20.30.40 to remote.connection.default.host=localhost

             

             

            I add the jboss-client jar which is under JBOSS_HOME/bin/client.

             

            EJBReceiverContext is successfully created.But, I still get the following error;

             

            ay 31, 2012 5:51:46 AM org.jboss.ejb.client.EJBClient <clinit>

            INFO: JBoss EJB Client version 1.0.5.Final

            May 31, 2012 5:51:46 AM org.xnio.Xnio <clinit>

            INFO: XNIO Version 3.0.3.GA

            May 31, 2012 5:51:46 AM org.xnio.nio.NioXnio <clinit>

            INFO: XNIO NIO Implementation Version 3.0.3.GA

            May 31, 2012 5:51:46 AM org.jboss.remoting3.EndpointImpl <clinit>

            INFO: JBoss Remoting version 3.2.3.GA

            May 31, 2012 5:51:46 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage

            INFO: Received server version 1 and marshalling strategies [river]

            May 31, 2012 5:51:46 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate

            INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@1ab28fe, receiver=Remoting connection EJB receiver [c

            onnection=Remoting connection <18088c0>,channel=jboss.ejb,nodename=acetmp3]} on channel Channel ID e7e55c54 (outbound) of Remoting connection 015212bc to localhost/127.0.0.1:4447

            May 31, 2012 5:51:46 AM org.jboss.ejb.client.remoting.ChannelAssociation$ResponseReceiver handleMessage

            WARN: Unsupported message received with header 0xffffffff

            Exception in thread "main" java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:YomaBankService,distinctname:] combination for invocation context org.

            jboss.ejb.client.EJBClientInvocationContext@1d80e6d

                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 $Proxy0.transferCash(Unknown Source)

                at com.mutu.gbt.ejb.client.YomaBankServiceClient2.runtTest(YomaBankServiceClient2.java:59)

                at com.mutu.gbt.ejb.client.YomaBankServiceClient2.main(YomaBankServiceClient2.java:64)

             

            Thank & Best Regards

            Zaw Than Oo