2 Replies Latest reply on Nov 26, 2017 11:42 PM by Kavintha Maduranga

    EJB3 stateless bean lookup failure

    Kavintha Maduranga Newbie

      I have deployed an stateless bean in EAP 7 Jboss and deployment logs as follows,

       

      2017-11-20 18:19:47,984 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-4) WFLYEJB0473: JNDI bindings for session bean named 'AdministrationBean' in deployment unit 'subdeployment "se.cambio.cosmic.spider-ConnectPublishPublishing.jar" of deployment "cosmic-ejb.ear"' are as follows:

       

          java:global/cosmic-ejb/se.cambio.cosmic.spider-ConnectPublishPublishing/AdministrationBean!se.cambiosys.connect.publish.publisher.administration.AdministrationTask

          java:app/se.cambio.cosmic.spider-ConnectPublishPublishing/AdministrationBean!se.cambiosys.connect.publish.publisher.administration.AdministrationTask

          java:module/AdministrationBean!se.cambiosys.connect.publish.publisher.administration.AdministrationTask

          java:jboss/exported/cosmic-ejb/se.cambio.cosmic.spider-ConnectPublishPublishing/AdministrationBean!se.cambiosys.connect.publish.publisher.administration.AdministrationTask

          java:global/cosmic-ejb/se.cambio.cosmic.spider-ConnectPublishPublishing/AdministrationBean

          java:app/se.cambio.cosmic.spider-ConnectPublishPublishing/AdministrationBean

          java:module/AdministrationBean

       

      And i'm trying to invoke a method using a simple main method as follows,

       

      try{

          Properties p = new Properties();

          p.put("endpoint.name", "client-endpoint");

          p.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");

          p.put("remote.connections", "one");

          p.put("remote.connection.one.port", "11990");

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

          p.put("remote.connection.one.host", "localhost");

          p.put("remote.connection.one.username", "quickUser");

          p.put("remote.connection.one.password", "quickPwd1!");

       

          EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(p);

          ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(cc);

          EJBClientContext.setSelector(selector);

       

          Properties props = new Properties();

          props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

          InitialContext context = new InitialContext(props);

       

       

          String rcal = "ejb:cosmic-ejb/se.cambio.cosmic.spider-ConnectPublishPublishing/ejb3//AdministrationBean!se.cambiosys.connect.publish.publisher.administration.AdministrationTask";

          AdministrationTask mbean = (AdministrationTask) context.lookup(rcal);

         Long nn = mbean.getPendingMessagesDLQ();

          }

          catch(Exception e)

          {

            e.printStackTrace();

          }

       

       

      But from the method invoking line (highlighted), i get this error -->

       

      [Remoting "client-endpoint" task-5] ERROR org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver - Failed to open channel for context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@bae7dc0, receiver=Remoting connection EJB receiver [connection=org.jboss.ejb.client.remoting.ConnectionPool$PooledConnection@209da20d,channel=jboss.ejb,nodename=CWLK-KAVINTHAM.cambio.se:6447:MANAGEMENT]}

      java.io.IOException: Unknown service name

      .

      .

      .

      java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:cosmic-ejb, moduleName:se.cambio.cosmic.spider-ConnectPublishPublishing, distinctName:ejb3] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@3cebbb30