Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-14801

[GSS](7.1.z) Remote Naming EJB invocation with EJB Client Legacy library throws EJBCLIENT000025: No EJB receiver available

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • None
    • EJB
    • None
    • +
    • Hide

      use maven to assemble the needed dependencies with:

      Excluded wildfly-naming-client from the EJB client legacy BOM
      Added jboss-remote-naming as a dependency

      Show
      use maven to assemble the needed dependencies with: Excluded wildfly-naming-client from the EJB client legacy BOM Added jboss-remote-naming as a dependency

      Remote Naming EJB invocation with EJB Client Legacy library throws EJBCLIENT000025: No EJB receiver available. The same code run using EAP 7.0 jboss-client.jar works.

              Hashtable<String, String> env = new Hashtable<String, String>();
              env.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
              env.put("java.naming.factory.initial", "org.jboss.naming.remote.client.InitialContextFactory");
              env.put("java.naming.provider.url", String.format("%s://%s:%d", protocol, host,  port));
              env.put("jboss.naming.client.ejb.context", "true"); // this needs to be set for RemoteNaming InitialContext to be able to invoke an ejb
              env.put(Context.SECURITY_PRINCIPAL, username);
              env.put(Context.SECURITY_CREDENTIALS, password);
      
              InitialContext ctx = new InitialContext(env);
                Hello ejb = (Hello) ctx.lookup("/ejb-client/Hello!com.jboss.examples.ejb.Hello");
                System.out.println(ejb.sayHello());
                ctx.close();
      
      java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:ejb-client, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@2aa5fe93
      	at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:825)
      	at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:128)
      	at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
      	at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:257)
      	at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:202)
      	at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:185)
      	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:148)
      	at com.sun.proxy.$Proxy2.sayHello(Unknown Source)
      	at com.jboss.examples.ejb.HelloClient.testRemoteProtocol(HelloClient.java:155)
      	at com.jboss.examples.ejb.HelloClient.main(HelloClient.java:48)
      

            rhn-support-iweiss Ingo Weiss
            rhn-support-bmaxwell Brad Maxwell
            Salvatore Colange Salvatore Colange (Inactive)
            Salvatore Colange Salvatore Colange (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: