0 Replies Latest reply on Nov 14, 2017 11:50 AM by pg593r_wildfly

    EJBCLIENT000025: No EJB receiver available for handling - WildFly 10

    pg593r_wildfly

      Hi,

      I am trying to make standalone remote EJB call on local server and followed steps from below given URL but i am getting this error after follow all the steps. I am able to make connection but failing when invoking method.

       

      URL:- EJB invocations from a remote client using JNDI - WildFly 10 - Project Documentation Editor

       

      Nov 14, 2017 10:34:54 AM org.jboss.ejb.client.EJBClient <clinit>

      INFO: JBoss EJB Client version 2.1.4.Final

      Nov 14, 2017 10:34:54 AM org.xnio.Xnio <clinit>

      INFO: XNIO version 3.4.0.Final

      Nov 14, 2017 10:34:54 AM org.xnio.nio.NioXnio <clinit>

      INFO: XNIO NIO Implementation Version 3.4.0.Final

      Nov 14, 2017 10:34:54 AM org.jboss.remoting3.EndpointImpl <clinit>

      INFO: JBoss Remoting version 4.0.21.Final

      Nov 14, 2017 10:34:55 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage

      INFO: EJBCLIENT000017: Received server version 2 and marshalling strategies [river]

      Nov 14, 2017 10:34:55 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate

       

      INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@10bbd20a, receiver=Remoting connection EJB receiver [connection=org.jboss.ejb.client.remoting.ConnectionPool$PooledConnection@48503868,channel=jboss.ejb,nodename=ilcdtl01pg593r]} on channel Channel ID 8f0935dc (outbound) of Remoting connection 30a3107a to localhost/127.0.0.1:8080 of endpoint "config-based-ejb-client-endpoint" <33c7e1bb>

       

      Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:jboss-as-ejb-remote-ear, distinctName:jboss-as-ejb-remote-app] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@42f93a98

          at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:798)

          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:255)

          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:200)

          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:183)

          at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146)

          at com.sun.proxy.$Proxy0.add(Unknown Source)

          at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.invokeStatelessBean(RemoteEJBClient.java:48)

          at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.main(RemoteEJBClient.java:29)

       

      Connection code

      private static RemoteCalculator lookupRemoteStatelessCalculator() throws NamingException {

               final Hashtable jndiProperties = new Hashtable();

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

               final Context context = new InitialContext(jndiProperties);

             

               Properties clientProperties = new Properties();

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

               clientProperties.put("remote.connections", "default");

               clientProperties.put("remote.connection.default.port", "8080");

               clientProperties.put("remote.connection.default.host", "localhost");

               clientProperties.put("remote.connection.default.username", "ejb");

               clientProperties.put("remote.connection.default.password", "ejbUser");

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

       

              

               EJBClientConfiguration ejbClientConfiguration = new PropertiesBasedEJBClientConfiguration(clientProperties);

               ContextSelector<EJBClientContext> contextSelector = new ConfigBasedEJBClientContextSelector(ejbClientConfiguration);

               EJBClientContext.setSelector(contextSelector);

              return (RemoteCalculator) context.lookup("ejb:/jboss-as-ejb-remote-ear/jboss-as-ejb-remote-app/CalculatorBean!com.prashant.ejb.RemoteCalculator");

              //return (RemoteCalculator) context.lookup("ejb:/jboss-as-ejb-remote-app/CalculatorBean!"+ RemoteCalculator.class.getName());

          }

       

      i am getting Name not found error if i use INITIAL_CONTEXT_FACTORY process as below.

       

      private static RemoteCalculator lookupRemoteStatelessCalculator() throws NamingException {

              final Hashtable<String, String> jndiProperties = new Hashtable<>();

            //  jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");

             jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");       

              jndiProperties.put(Context.PROVIDER_URL,"http-remoting://localhost:8080");

              final Context context = new InitialContext(jndiProperties);

       

              return (RemoteCalculator) context.lookup("ejb:/jboss-as-ejb-remote-ear/jboss-as-ejb-remote-app/CalculatorBean!com.prashant.ejb.RemoteCalculator");

              //return (RemoteCalculator) context.lookup("ejb:/jboss-as-ejb-remote-app/CalculatorBean!"+ RemoteCalculator.class.getName());

          }

       

      Exception in thread "main" javax.naming.NameNotFoundException: ejb:/jboss-as-ejb-remote-ear/jboss-as-ejb-remote-app/CalculatorBean!com.prashant.ejb.RemoteCalculator -- service jboss.naming.context.java.jboss.exported.ejb:.jboss-as-ejb-remote-ear.jboss-as-ejb-remote-app."CalculatorBean!com.prashant.ejb.RemoteCalculator"

          at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)

          at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)

          at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

          at java.lang.Thread.run(Thread.java:748)

       

      Please help, i might be missing some configuration.

       

      Thanks in advance!!!