0 Replies Latest reply on Mar 11, 2016 7:10 AM by Gerd Wagner

    Wildfly 10.0.0.Final: Session bean’s business interface cannot be passed as return value to remote clients

    Gerd Wagner Newbie

      Wildfly 10.0.0.Final: Session bean’s business interface cannot be passed as return value to remote clients.

       

      Reproduction:

      Call the createEJBTestBean() method of the bean implementation below from a remote client. Then try to invoke any business method on the returned business interface. This results in a

      "java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling ..." exception.


      {code:java}

      @Stateless
      @RemoteHome(EJBFactoryTestHome.class)

      public class EJBFactoryTestBean implements SessionBean, EJBFactoryTestBI

      {

       

         @Override
         public EJBTest createEJBTestBean()

        {

        try
        {
              EJBTestHome home = (EJBTestHome) new InitialContext().lookup("...");
              return home.create();
        }
        catch(RemoteException | CreateException | NamingException e)
        {
              throw new RuntimeException(e);
        }

         }

       

         public void setSessionContext(SessionContext ctx)

         {

         }

       

         public void ejbCreate()

         {

         }

       

         public void ejbActivate()

         {

         }

       

         public void ejbPassivate()

         {

         }

       

         public void ejbRemove()

         {

         }

      }

      {code}


      Note 1: Citation from ejb-3_2-core-fr-spec section 3.4.3 second sentence: "A reference to a session bean’s business interface may be passed as a parameter or return value of a business interface method."


      Note 2: We are working on porting our EJB application to Wildfly 10.0.0 Final. Large parts of the application still use the old fashioned Home-Remote style beans. I don't expect using POJO/POJI-beans would have any impact on the problem. Anyway it would remain a bug even if it occurred with old style beans only.