1 2 Previous Next 19 Replies Latest reply on Oct 25, 2012 11:22 AM by wdfink Go to original post
      • 15. Re: java.lang.IllegalStateException: No EJB receiver available for handling
        jaikiran

        To add to what Wolf mentioned

        Matt Forshaw wrote:

         

        I would be interested to know what the expected bahaviour is when a bean is deployed to more than one server.

        ...

         

        Identical EJBs are deployed on two JBoss instances (one with port offset 100, another with port offset 200).

        ...

         

        Under AS7, I am seeing both calls directed towards a single server (it is not clear at present how one server is chosen over another - I'll keep digging).

        If the 2 beans are identical, then in most of the cases it shouldn't matter to which server the invocation ends up on. However if your beans are different, then they will either have a different app name, module name, distinct name or bean name and the EJB client API will be able to find out which of those 2 servers hosts that bean and will be able to invoke on it.

         

        As for how the EJB client API chooses a server if multiple servers have the same EJB then it uses an implementation of DeploymentNodeSelector interface. The default implementation is a random node selector. However, if you want more control over which server gets chosen for the bean, then you can configure an implementation of your own to manage this. More details here https://issues.jboss.org/browse/EJBCLIENT-31?focusedCommentId=12696416&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12696416

         

         

        Matt Forshaw wrote:

         

         

        Also, if I do not start up one of the two remote servers, no exception is thrown when trying to create the InitialContext and the calls are directed to the other server.

         

        For stateless bean lookups we don't really need any server side interaction and hence one of the optimizations that the EJB client API, has built in, is that we create such proxies locally without communicating with the server. When the first invocation happens on that proxy, we start communicating with the server via this proxy. This is a feature and not a bug. Note that for stateful beans though, we have to communicate with the server during the lookup itself since the lookup has to trigger a session creation for the SFSB instance on the server side. That's exactly why we require the client applications to append a "?stateful" string at the end of the lookup JNDI name so that the EJB client API knows that it's a lookup for a stateful bean.

        • 16. Re: java.lang.IllegalStateException: No EJB receiver available for handling
          jaikiran

          Matt Forshaw wrote:

           

          Is it possible to specify programmatically which server to direct calls to, and to disable any attempts to fail over onto another server if one is unavailable?

           

          For a non-clustered bean, the DeploymentNodeSelector is what you need to configure. But you could also prevent the failover by not adding that server in the EJB client context, in first place.

           

          By the way, I'm actually curious about the demo(?) that you are using these configurations for. Maybe I could help better if knew a bit more about the application and what it's trying to do.

          • 17. Re: java.lang.IllegalStateException: No EJB receiver available for handling
            wdfink

            Do you require a specific version of AS7 to get this working? I ran the install-domain.cli script against a fresh jbossas-7.1.1.Final and I get the following output:

             

            The quickstart was updated to 7.1.2 you need to remove this lines from the script, I'll add notes for this. Thanks for report it.

             

            /profile=default-web/subsystem=naming/service=remote-naming:add

            /host=master/core-service=management/security-realm=ApplicationRealm/authentication=local:remove

            • 18. Re: java.lang.IllegalStateException: No EJB receiver available for handling
              paul.robinson

              Jaikiran,

               

              Thanks for your help. Here's some more context.

               

              This work is for a practical session for a Masters course at Newcastle University. The students start by creating an EJB service for a hotel, taxi agency or flight company. This service offers simple book and cancel methods. They write a webapp to invoke this service. Once they have this working, they create a travel agent that books a hotel, taxi and flight (withing a JTS transaction). They have to use two different colleagues' services for the additional services. Whilst waiting for other services to become available, we get the faster students to write their travel agent against multiple instances of there own service. They then replace these when the real ones become available.

               

              I think the simplest solution is to tell the faster students to rename the jar containing the EJB so that the appname is different for each instance.

               

              Does that make sense?

               

              Paul.

              • 19. Re: java.lang.IllegalStateException: No EJB receiver available for handling
                wdfink

                Yes that is the simple way without extra configuration or custom-classes.

                 

                If each student use a distinct jar-name you are able to add all connections and pic the wanted instance simple with the module(jar) name.

                1 2 Previous Next