JBoss Community

No EJB receiver available for handling in JBoss AS 7

created by Zaw Than Oo in JBoss AS 7 Development - View the full discussion

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

 

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();

    }

}

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community