0 Replies Latest reply on Mar 18, 2019 2:43 PM by jasipher

    How to implement EJB over HTTP for remote client

    jasipher

      This page from the WildFly 11 announcement says "if you are currently using 'remote+http://localhost:8080' as the target URI, you would change this to 'http://localhost:8080/wildfly-services'." There apparently is more to it than that, or something has changed since WildFly 11.

       

      I've set up wildfly-config.xml like this:

      <configuration>
           <authentication-client xmlns="urn:elytron:client:1.3">
               <authentication-rules>
                   <rule use-configuration="default"/>
               </authentication-rules>
               <authentication-configurations>
                   <configuration name="default">
                       <set-authorization-name name="ejb"/>
                       <credentials>
                           <clear-password password="mypassword"/>
                       </credentials>
                   </configuration>
               </authentication-configurations>
           </authentication-client>
           <jboss-ejb-client xmlns="urn:jboss:wildfly-client-ejb:3.0">
               <connections>
                   <connection uri="http://localhost:8080/wildfly-services" />
                   <connection uri="http://localhost:8180/wildfly-services" />
               </connections>
           </jboss-ejb-client>
      </configuration>
      

       

      When I try to invoke the remote EJB I get "javax.ejb.NoSuchEJBException: EJBCLIENT000079: Unable to discover destination for request for EJB StatelessEJBLocator for "myear/myejb/mydistinctname/myinterface", view is interface".

       

      When I step through the code in the remote client, I find that it's failing in this section of org.jboss.ejb.protocol.remote.RemoteTransportProvider. It looks like 'http' isn't a valid protocol in jboss-ejb-client-4.0.14.Final.

          public boolean supportsProtocol(final String uriScheme) {
              switch (uriScheme) {
                  case "remote":
                  case "remote+http":
                  case "remote+https":
                  // compatibility
                  case "remoting":
                  case "http-remoting":
                  case "https-remoting": {
                      return true;
                  }
                  default: {
                      return false;
                  }
              }
          }
      

       

      Is this a regression in jboss-ejb-client, or is the page from the WildFly 11 announcement incorrect and I really should be using http-remoting?