4 Replies Latest reply on Apr 21, 2013 11:02 AM by ivankostyuk

    JBoss AS 7.1.1 remote EJB lookup causes - No EJB receiver available for handling

    ivankostyuk

      Hello.

       

      Reading of post and documentation (https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI) did not help me much. With JBoss4 everything was simple. I can call my EJB from server in Jboss AS 7.1.1. But, I need to call it from external client.

      I took project from the link above about

      EJB invocations from a remote client using JNDI

      I read that some people manage to solve the problem, but still, I cannot get how they did it.

      Could anyone give a solution? At least to point right direction.

      Using the project above (only stateful part). JBoss running with default configuration (OOB).

       

       

       

      Server output:

       


      java:global/CalcExPrj/CounterBean!stateful.RemoteCounter

      java:app/CalcExPrj/CounterBean!stateful.RemoteCounter

      java:module/CounterBean!stateful.RemoteCounter

      java:jboss/exported/CalcExPrj/CounterBean!stateful.RemoteCounter

      java:global/CalcExPrj/CounterBean

      java:app/CalcExPrj/CounterBean

      java:module/CounterBean

       

      Client output:

      javax.naming.NamingException: Failed to create proxy [Root exception is java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:jboss-as-ejb-remote-server-side,distinctname:] combination]

                at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:115)

                at org.jboss.ejb.client.naming.ejb.EjbNamingContext.lookup(EjbNamingContext.java:96)

                at javax.naming.InitialContext.lookup(Unknown Source)

                at client.RemoteEJBClient.lookupRemoteStatefulCounter(RemoteEJBClient.java:75)

                at client.RemoteEJBClient.invokeStatefulBean(RemoteEJBClient.java:19)

                at client.RemoteEJBClient.main(RemoteEJBClient.java:14)

      Caused by: java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:jboss-as-ejb-remote-server-side,distinctname:] combination

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

                at org.jboss.ejb.client.EJBClient.createSession(EJBClient.java:161)

                at org.jboss.ejb.client.naming.ejb.EjbNamingContext.doCreateProxy(EjbNamingContext.java:135)

                at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:113)

                ... 5 more

        • 1. Re: JBoss AS 7.1.1 remote EJB lookup causes - No EJB receiver available for handling
          wdfink

          The name depends on the deployed archive.

          <ear name>/<module name>/<distinct nam>/<name of the bean>!<interface>

           

          You might have a look into my quickstart

          1 of 1 people found this helpful
          • 2. Re: JBoss AS 7.1.1 remote EJB lookup causes - No EJB receiver available for handling
            ivankostyuk

            Thank you Wolf-Dieter Fink.

             

            That project is useful to check full functionality of JBoss, to play with Maven, and to check how changes in code could affect results. This project helped me to understand that everything I did I did right.

             

            I've found the answer and it is:

            To run remote EJB client application should include following seven one jars:

            jboss/bin/client/jboss-client.jar

            jboss/modules/org/jboss/ejb-client/main/jboss-ejb-client-1.0.5.Final.jar

            jboss/modules/org/jboss/marshalling/main/jboss-marshalling-1.3.11.GA.jar

            jboss/modules/org/jboss/xnio/main/xnio-api-3.0.3.GA.jar

            jboss/modules/org/jboss/remoting3/main/jboss-remoting-3.2.3.GA.jar

            jboss/modules/org/jboss/xnio/nio/main/xnio-nio-3.0.3.GA.jar

            jboss/modules/org/jboss/sasl/main/jboss-sasl-1.0.0.Final.jar

             

            Answered.

            • 3. Re: JBoss AS 7.1.1 remote EJB lookup causes - No EJB receiver available for handling
              wdfink

              All necessary classes should be packed into the bin/client/jboss-client.jar, see the README in that directory.

              If there are CNF Exceptions I suppose it will be a bug.

              1 of 1 people found this helpful
              • 4. Re: JBoss AS 7.1.1 remote EJB lookup causes - No EJB receiver available for handling
                ivankostyuk

                Thank you very much Wolf-Dieter Fink.

                Somehow, I've managed to spoil my project, but I started from only one right jar included (and server side project of cause).

                 

                I've checked README again and did a try out. Now, everything is working fine.

                 

                So, I'm changing right answer.

                 

                For non-maven environments only one jar must be used what contains everything client can require (except remote interfaces).

                jboss/bin/client/jboss-client.jar

                 

                I've noticed that assemled by Maven jar is three times smaller (in context of quickstart project) than jboss-client.jar

                 

                Thanks again.