6 Replies Latest reply on Sep 2, 2015 4:15 AM by necrolax

    EJB stateless issue EJBCLIENT000025: No EJB receiver available for handling

    necrolax

      Hi,

       

      I am trying to create an EJB stateless session bean in Wildfly 8.2. I need to create the stateless session without annotations and need where to configure appropriate properties in xml. I am getting the following error when i try to lookup the stateless bean

       

      Aug 29, 2015 6:44:42 PM org.jboss.ejb.client.EJBClient <clinit>

      INFO: JBoss EJB Client version 2.0.1.Final

      Proxy for remote EJB StatelessEJBLocator{appName='MyFirstSessionBeanExample', moduleName='MyFirstWildFlySessionBean', distinctName='', beanName='RemoteCalculator', view='interface com.wildfly.RemoteCalculatorRemote'}

      Obtained a remote stateless calculator for invocation

      Adding 204 and 340 via the remote stateless calculator deployed on the server

      Aug 29, 2015 6:44:42 PM org.xnio.Xnio <clinit>

      INFO: XNIO version 3.3.0.Final

      Aug 29, 2015 6:44:42 PM org.xnio.nio.NioXnio <clinit>

      INFO: XNIO NIO Implementation Version 3.3.0.Final

      Aug 29, 2015 6:44:43 PM org.jboss.remoting3.EndpointImpl <clinit>

      INFO: JBoss Remoting version 4.0.6.Final

      Aug 29, 2015 6:44:43 PM org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector setupEJBReceivers

      WARN: Could not register a EJB receiver for connection to 10.223.30.88:4447

      java.lang.RuntimeException: java.io.EOFException: XNIO000812: Connection closed unexpectedly

        at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:92)

        at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:77)

        at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51)

        at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:155)

        at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:115)

        at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:47)

        at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:271)

        at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281)

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

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

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

        at com.wildfly.Client.invokeStatelessBean(Client.java:47)

        at com.wildfly.Client.main(Client.java:28)

      Caused by: java.io.EOFException: XNIO000812: Connection closed unexpectedly

        at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:416)

        at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:400)

        at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)

        at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)

        at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:88)

        at org.xnio.nio.WorkerThread.run(WorkerThread.java:539)

        at ...asynchronous invocation...(Unknown Source)

        at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:272)

        at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:388)

        at org.jboss.ejb.client.remoting.EndpointPool$PooledEndpoint.connect(EndpointPool.java:187)

        at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:153)

        at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:133)

        at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:75)

        ... 11 more

       

       

      Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:MyFirstSessionBeanExample, moduleName:MyFirstWildFlySessionBean, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@335eadca

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

        at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)

        at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)

        at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)

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

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

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

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

        at com.wildfly.Client.invokeStatelessBean(Client.java:47)

        at com.wildfly.Client.main(Client.java:28)

       

       

      Could anyone please suggest when we will get this error ??

       

      Any working sample code ??

        • 1. Re: EJB stateless issue EJBCLIENT000025: No EJB receiver available for handling
          wdfink

          Did you had look to the wildfly quickstarts Quickstarts ?

           

          From the name I suppose MyFirstWildFlySessionBean is the bean name and not the name of the JAR. How your deployment look like? Did you use an ear or a simple jar and how you create the client?

          Maybe the quickstart help here.

          The XNIO000812 might network related, how your environment look like?

          • 2. Re: EJB stateless issue EJBCLIENT000025: No EJB receiver available for handling
            mayerw01

            How are you doing the EJB lookup?

            The reason for the EJBCLIENT000025 message might be that the property jboss.naming.client.ejb.context is not set to true.

            • 3. Re: EJB stateless issue EJBCLIENT000025: No EJB receiver available for handling
              necrolax

              Hi all,

               

              Please find the attached files. I have used the RemoteCalculator stateless session bean example from WildFly online doc.

               

              Thanks

              • 4. Re: EJB stateless issue EJBCLIENT000025: No EJB receiver available for handling
                wdfink

                You try to mix the ejb-client and the remote-naming approach.

                Ty to remove "jboss.naming.client.ejb.context" from your InitialContext

                • 5. Re: EJB stateless issue EJBCLIENT000025: No EJB receiver available for handling
                  mayerw01

                  Is your port number really 4447? Usually this is 8080.

                  This works in my environment. Maybe you can try this approach:

                   

                  public class TestRemoteClient {

                      public static void main(String[] args) {

                          if (args.length < 2)

                          {

                              System.err.println ("2 integer values expected");

                              System.exit(99);

                           }

                          int val1 = parseInt(args [0]);

                          int val2 = parseInt(args [1]);

                         

                          Properties props = new Properties();

                   

                          final String bean = "TestRemoteJNDI/TestRemoteJNDI-ejb/CalculateBean!ejb.CalculateBeanRemote";

                   

                          CalculateBeanRemote cal;

                          System.out.println("Testing with: " + bean);

                               

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

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

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

                          props.put(Context.SECURITY_PRINCIPAL, "guest");

                          props.put(Context.SECURITY_CREDENTIALS, "guest");

                   

                          // to avoid: java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available

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

                          try {

                              final Context context = new InitialContext(props);

                              cal = (CalculateBeanRemote) context

                                      .lookup(bean);

                              System.out.println("Lookup complete");

                   

                              System.out.println(val1 + " + " + val2 + " = " + cal.add(val1, val2));

                              // context.close();   // throws: java.util.concurrent.RejectedExecutionException

                          } catch (NamingException e) {

                              e.printStackTrace();

                          }

                      }

                  }

                  • 6. Re: EJB stateless issue EJBCLIENT000025: No EJB receiver available for handling
                    necrolax

                    Thank you ...!!!! It solved the problem ..