0 Replies Latest reply on Jun 3, 2016 1:02 AM by jashan07

    EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:ApplicationReader, dis tinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInv ocationContex

    jashan07

      Hello,

       

      I am trying to lookup remote interface by using below code but I m getting errors.

      Please direct me where I am going wrong.

       

      jar Deployed console in JBOSS EAP 6.3:

      21:16:23,329 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeplo

      ymentUnitProcessor] (MSC service thread 1-6) JNDI bindings for session bean name

      d ApplicationReaderClient in deployment unit deployment "ApplicationReader.jar"

      are as follows:

       

              java:global/ApplicationReader/ApplicationReaderClient!com.qwest.lsrm.ent

      ities.ApplicationReader

              java:app/ApplicationReader/ApplicationReaderClient!com.qwest.lsrm.entiti

      es.ApplicationReader

              java:module/ApplicationReaderClient!com.qwest.lsrm.entities.ApplicationR

      eader

              java:jboss/exported/ApplicationReader/ApplicationReaderClient!com.qwest.

      lsrm.entities.ApplicationReader

              java:global/ApplicationReader/ApplicationReaderClient

              java:app/ApplicationReader/ApplicationReaderClient

              java:module/ApplicationReaderClient

       

      21:16:23,345 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 49) JBAS0114

      02: Starting Persistence Unit Service 'ApplicationReader.jar#lsrmPersistenceUnit

      Look up and context code:

      public static Context newInitialContext() throws NamingException {

           

               Context initialContext=null;

       

          final String PKG_INTERFACES = "org.jboss.ejb.client.naming";

            try {

              if (initialContext == null) {

            

               System.out.println("inside newInitialContext");

                Properties ne= new Properties();

               ne.put("java.naming.factory.initial", "org.jboss.naming.remote.client.InitialContextFactory");

               ne.put("java.naming.factory.url.pkgs","org.jboss.ejb.client.naming");

               ne.put("java.naming.provider.url", "remote://localhost:4447");

               ne.put("java.naming.security.principal", "user");

               ne.put("java.naming.security.credentials", "user@2016");

               ne.put("jboss.naming.client.ejb.context", true);

               ne.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS","false");

                  initialContext = new InitialContext(ne);

              }

              return initialContext;

          }

             catch (NamingException var1) {

              System.out.println("error var1:"+var1);

               throw var1;

            }

         }

       

      Look up code:

      public static ApplicationReader lookup() throws NamingException {

            

              Context ctx = null;

              ApplicationReader appReader=null;

               String appName = "";

              String moduleName = "ApplicationReader";

              String distinctName = "";

              String beanName = ApplicationReaderClient.class.getSimpleName();

              final String interfaceName = ApplicationReader.class.getName();

             

               String name = "ejb:" + appName + "/" + moduleName + "/" +

                      distinctName    + "/" + beanName + "!" + interfaceName;

              try{

              ctx=newInitialContext();

             

              System.out.println("context "+ ctx);

              appReader = (ApplicationReader) ctx.lookup(name);

             

               System.out.println("appReader "+ appReader);

              

               }

               catch(NamingException e)

               {

               System.out.println(e.getMessage());

              

               }

               finally

               {

               ctx.close();

               }

              return appReader;

          }

      '

       

      Advance Thanks for the help!