8 Replies Latest reply on Apr 3, 2018 6:58 AM by javax4u

    Why is Wildfly 11 pure http invocation not working?

    andreizu

      Hi everyone,


      I have been trying to make the "pure" http EJB invocation from a remote server instance, without success.

      The client module was built inside a war file, while the server artifact was build in an ear file.

       

       

      Jan 05, 2018 3:16:45 PM org.wildfly.naming.client.Version <clinit>
       INFO: WildFly Naming version 1.0.7.Final
       Jan 05, 2018 3:16:45 PM org.wildfly.security.Version <clinit>
       INFO: ELY00001: WildFly Elytron version 1.1.6.Final
       jndiName: ejb:wejb/wejb/CalculatorEJB!br.com.server.Calculator
       Jan 05, 2018 3:16:45 PM org.xnio.Xnio <clinit>
       INFO: XNIO version 3.5.4.Final
       Jan 05, 2018 3:16:45 PM org.xnio.nio.NioXnio <clinit>
       INFO: XNIO NIO Implementation Version 3.5.4.Final
       Jan 05, 2018 3:16:45 PM org.jboss.remoting3.EndpointImpl <clinit>
       INFO: JBoss Remoting version 5.0.5.Final
       Jan 05, 2018 3:16:45 PM org.jboss.ejb.client.EJBClient <clinit>
       INFO: JBoss EJB Client version 4.0.7.Final
       Proxy for remote EJB StatelessEJBLocator for "wejb/wejb/CalculatorEJB", view is interface br.com.server.Calculator, affinity is None
       24.15

       

       

      2018-01-05 15:18:41,813 INFO  [stdout] (default task-21) jndiName: ejb:wejb/wejb/CalculatorEJB!br.com.server.Calculator
      2018-01-05 15:18:41,819 INFO  [stdout] (default task-21) Proxy for remote EJB StatelessEJBLocator for "wejb/wejb/CalculatorEJB", view is interface br.com.server.Calculator, affinity is None
      2018-01-05 15:18:42,036 INFO  [stdout] (default task-21) 24.15

       

      2018-01-05 15:30:07,346 INFO  [stdout] (default task-44) jndiName: ejb:wejb/wejb/CalculatorEJB!br.com.server.Calculator
      2018-01-05 15:30:07,351 INFO  [stdout] (default task-44) Proxy for remote EJB StatelessEJBLocator for "wejb/wejb/CalculatorEJB", view is interface br.com.server.Calculator, affinity is None
      2018-01-05 15:30:07,352 ERROR [io.undertow.request] (default task-44) UT005023: Exception handling request to /web/: org.apache.jasper.JasperException: org.jboss.ejb.client.RequestSendFailedException: EJBCLIENT000409: No more destinations are available
               at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:473)
               at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
               at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
               at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
               at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
               at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32)
               at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
               at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
               at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
               at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
               at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
               at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
               at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
               at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
               at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
               at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
               at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
               at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
               at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
               at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
               at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
               at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
               at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
               at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
               at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
               at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
               at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
               at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
               at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
               at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
               at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction$$Lambda$852/801580157.call(Unknown Source)
               at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
               at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$853/1002843216.call(Unknown Source)
               at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
               at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$853/1002843216.call(Unknown Source)
               at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
               at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$853/1002843216.call(Unknown Source)
               at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
               at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$853/1002843216.call(Unknown Source)
               at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
               at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
               at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
               at io.undertow.server.Connectors.executeRootHandler(Connectors.java:326)
               at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)
               at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
               at java.lang.Thread.run(Thread.java:745)
      Caused by: org.jboss.ejb.client.RequestSendFailedException: EJBCLIENT000409: No more destinations are available
               at org.jboss.ejb.client.EJBReceiverInvocationContext$ResultProducer$Failed.getResult(EJBReceiverInvocationContext.java:151)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:567)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
               at org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocationResult(RemotingEJBClientInterceptor.java:56)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
               at org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocationResult(TransactionPostDiscoveryInterceptor.java:133)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
               at org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocationResult(DiscoveryEJBClientInterceptor.java:118)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
               at org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocationResult(NamingEJBClientInterceptor.java:78)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
               at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:172)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)
               at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
               at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:907)
               at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:165)
               at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:100)
               at com.sun.proxy.$Proxy61.calculateInterest(Unknown Source)
               at br.com.client.RemoteEJBClient.main(RemoteEJBClient.java:20)
               at br.com.client.RemoteEJBClient.func(RemoteEJBClient.java:14)
               at org.apache.jsp.index_jsp._jspService(index_jsp.java:99)
               at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
               at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
               ... 47 more
               Suppressed: javax.ejb.NoSuchEJBException: EJBCLIENT000024: No EJB receiver available for handling destination "http://localhost:8080/wildfly-services"
                      at org.jboss.ejb.client.EJBClientContext.resolveReceiver(EJBClientContext.java:571)
                      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:438)
                      at org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocation(RemotingEJBClientInterceptor.java:51)
                      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:466)
                      at org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocation(TransactionPostDiscoveryInterceptor.java:79)
                      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:466)
                      at org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocation(DiscoveryEJBClientInterceptor.java:90)
                      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:466)
                      at org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocation(NamingEJBClientInterceptor.java:66)
                      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:466)
                      at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:165)
                      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:466)
                      at org.jboss.ejb.client.EJBClientInvocationContext$$Lambda$915/72354668.accept(Unknown Source)
                      at org.wildfly.common.context.Contextual.runExConsumer(Contextual.java:203)
                      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequestInitial(EJBClientInvocationContext.java:302)
                      at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:161)
                      ... 55 more

       

       

      The client:

       

      package br.com.client;
      
      
      import java.util.Properties;
      
      
      import javax.naming.Context;
      import javax.naming.InitialContext;
      import javax.naming.NamingException;
      
      import br.com.server.Calculator;
      
      public class RemoteEJBClient {
      
      
          public void func() throws Exception {
              RemoteEJBClient.main();
          }
      
          public static void main(String ... args) throws Exception {
              Calculator calc = (Calculator) lookup(Calculator.class, "wejb");
              System.out.println(calc);
              System.out.println(calc.calculateInterest(23L));
          }
      
          @SuppressWarnings("unchecked")
          public static <T> T lookup(Class<T> t, String packageName) throws NamingException {
              Properties properties = new Properties();
              properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");
              properties.put(Context.PROVIDER_URL, "http://localhost:8080/wildfly-services");
              InitialContext context = new InitialContext(properties);
              StringBuilder jndiName = new StringBuilder();
              jndiName.append("ejb:");
              jndiName.append(packageName);
              jndiName.append("/");
              jndiName.append(packageName);
              jndiName.append("/");
              jndiName.append(t.getSimpleName());
              jndiName.append("EJB!");
              jndiName.append(t.getName());
              System.out.println("jndiName: " + jndiName);
              return (T) context.lookup(jndiName.toString());
          }
      }
      
      
      
      
      
      
      

       

      The wildfly-config.xml

       

      <configuration>
      <authentication-client xmlns="urn:elytron:1.0">
              <authentication-rules>
                  <rule use-configuration="default"/>
              </authentication-rules>
              <authentication-configurations>
                  <configuration name="default">
                      <sasl-mechanism-selector selector="DIGEST-MD5"/>
                      <set-user-name name="ejb"/>
                      <credentials>
                          <clear-password password="ejb"/>
                      </credentials>
                  </configuration>
              </authentication-configurations>
          </authentication-client>
      </configuration>
      

       

      The client pom.xml

       

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>br.com.client</groupId>
      <artifactId>web</artifactId>
      <version>1.0</version>
      <name>projeto-web</name>
      
      
      <packaging>war</packaging>
      <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <version.compiler.plugin>3.1</version.compiler.plugin>
      <version.war.plugin>2.1.1</version.war.plugin>
      <maven.compiler.target>1.8</maven.compiler.target>
      <maven.compiler.source>1.8</maven.compiler.source>
      </properties>
      <repositories>
      <repository>
      <id>JBoss Repository</id>
      <url>https://repository.jboss.org/nexus/content/groups/public/</url>
      </repository>
      </repositories>
      
      
      <dependencies>
      
      
      <dependency>
      <groupId>org.wildfly</groupId>
      <artifactId>wildfly-ejb-client-bom</artifactId>
      <version>11.0.0.Final</version>
      <type>pom</type>
      </dependency>
      
      
      <dependency>
      <groupId>br.com.server</groupId>
      <artifactId>wejb</artifactId>
      <version>1.0</version>
      <type>ejb-client</type>
      </dependency>
      
      
      <dependency>
      <groupId>br.com.server</groupId>
      <artifactId>wejb</artifactId>
      <version>1.0</version>
      <type>ejb</type>
      <scope>provided</scope>
      </dependency>
      
      
      </dependencies>
      
      
      <build>
      <finalName>${project.artifactId}</finalName>
      <plugins>
      <plugin>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>${version.compiler.plugin}</version>
      <configuration>
      <source>${maven.compiler.source}</source>
      <target>${maven.compiler.target}</target>
      </configuration>
      </plugin>
      
      
      </plugins>
      </build>
      
      
      </project>
      

       

      The server interface class:

       

      package br.com.server;
      
      public interface Calculator {
          public float calculateInterest(long money);
      }
      
      

       

      The server EJB class:

       

      package br.com.server;
      
      
      import javax.ejb.Remote;
      import javax.ejb.Stateless;
      
      
      @Stateless
      @Remote(Calculator.class)
      public class CalculatorEJB implements Calculator {
      
      
          float interest = 5;
      
      
          public float calculateInterest(long money) {
      
      
              return money * (1 + (interest / 100));
          }
      }
      
      
      
      
      
      
      
      
      
      
      
      

       

       

      Thanks in advance.

        • 1. Re: Why is Wildfly 11 pure http invocation not working?
          jaikiran

          Can you enable TRACE level logging of the org.jboss.ejb.client package on the client side and attach those logs here?

          • 2. Re: Why is Wildfly 11 pure http invocation not working?
            andreizu

            Hello Jaikiran,

             

            Looks like a problem with Blacklisting, I still need to do some research.

            2018-01-08 08:56:06,977 INFO  [org.wildfly.naming] (default task-2) WildFly Naming version 1.0.7.Final

            2018-01-08 08:56:06,994 INFO  [stdout] (default task-2) jndiName: ejb:wejb/wejb/CalculatorEJB!br.com.server.Calculator

            2018-01-08 08:56:07,020 INFO  [org.jboss.ejb.client] (default task-2) JBoss EJB Client version 4.0.7.Final

            2018-01-08 08:56:07,027 INFO  [stdout] (default task-2) Proxy for remote EJB StatelessEJBLocator for "wejb/wejb/CalculatorEJB", view is interface br.com.server.Calculator, affinity is None

            2018-01-08 08:56:07,027 DEBUG [org.jboss.ejb.client.invocation] (default task-2) Calling invoke(module = wejb/wejb/CalculatorEJB, strong affinity = None, weak affinity = None):

            2018-01-08 08:56:07,083 TRACE [org.jboss.ejb.client] (default task-2) Transitioning org.jboss.ejb.client.EJBClientInvocationContext@12816480 from SENDING to SENT

            2018-01-08 08:56:07,083 TRACE [org.jboss.ejb.client.invocation] (default task-2) Blacklisting destination (locator = StatelessEJBLocator for "wejb/wejb/CalculatorEJB", view is interface br.com.server.Calculator, affinity is None, weak affinity = None, missing target = http://localhost:8080/wildfly-services)

            2018-01-08 08:56:07,084 TRACE [org.jboss.ejb.client] (default task-2) Transitioning org.jboss.ejb.client.EJBClientInvocationContext@12816480 from SENT to SENDING

            2018-01-08 08:56:07,085 TRACE [org.jboss.ejb.client] (default task-2) Transitioning org.jboss.ejb.client.EJBClientInvocationContext@12816480 from SENDING to SENT

            2018-01-08 08:56:07,086 TRACE [org.jboss.ejb.client] (default task-2) Transitioning org.jboss.ejb.client.EJBClientInvocationContext@12816480 from SENT to READY

            2018-01-08 08:56:07,087 TRACE [org.jboss.ejb.client] (default task-2) Transitioning org.jboss.ejb.client.EJBClientInvocationContext@12816480 from READY to CONSUMING

            2018-01-08 08:56:07,089 TRACE [org.jboss.ejb.client] (default task-2) Transitioning org.jboss.ejb.client.EJBClientInvocationContext@12816480 from CONSUMING to DONE

            2018-01-08 08:56:07,090 ERROR [io.undertow.request] (default task-2) UT005023: Exception handling request to /web/index.jsp: org.apache.jasper.JasperException: org.jboss.ejb.client.RequestSendFailedException: EJBCLIENT000409: No more destinations are available

            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:473)

            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)

            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

            at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

            at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

            at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32)

            at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

            at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

            at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

            at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

            at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

            at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

            at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

            at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

            at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

            at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

            at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

            at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

            at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

            at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)

            at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)

            at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)

            at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)

            at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)

            at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)

            at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

            at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)

            at io.undertow.server.Connectors.executeRootHandler(Connectors.java:326)

            at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

            at java.lang.Thread.run(Thread.java:748)

            Caused by: org.jboss.ejb.client.RequestSendFailedException: EJBCLIENT000409: No more destinations are available

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:567)

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)

            at org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocationResult(RemotingEJBClientInterceptor.java:56)

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)

            at org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocationResult(TransactionPostDiscoveryInterceptor.java:133)

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)

            at org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocationResult(DiscoveryEJBClientInterceptor.java:118)

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)

            at org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocationResult(NamingEJBClientInterceptor.java:78)

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)

            at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:172)

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)

            at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)

            at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:907)

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

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

            at com.sun.proxy.$Proxy59.calculateInterest(Unknown Source)

            at br.com.client.RemoteEJBClient.main(RemoteEJBClient.java:20)

            at br.com.client.RemoteEJBClient.func(RemoteEJBClient.java:14)

            at org.apache.jsp.index_jsp._jspService(index_jsp.java:99)

            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)

            ... 42 more

            Suppressed: javax.ejb.NoSuchEJBException: EJBCLIENT000024: No EJB receiver available for handling destination "http://localhost:8080/wildfly-services"

            at org.jboss.ejb.client.EJBClientContext.resolveReceiver(EJBClientContext.java:571)

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

            at org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocation(RemotingEJBClientInterceptor.java:51)

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

            at org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocation(TransactionPostDiscoveryInterceptor.java:79)

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

            at org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocation(DiscoveryEJBClientInterceptor.java:90)

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

            at org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocation(NamingEJBClientInterceptor.java:66)

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

            at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:165)

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

            at org.wildfly.common.context.Contextual.runExConsumer(Contextual.java:203)

            at org.jboss.ejb.client.EJBClientInvocationContext.sendRequestInitial(EJBClientInvocationContext.java:302)

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

            ... 50 more

            Best regards!

            • 3. Re: Why is Wildfly 11 pure http invocation not working?
              jaikiran

              Looking at those logs and the corresponding EJB client code, it seems that the server side probably is returning a "no such EJB" response/exception. I'm not sure why that would be the case when the non-http based invocation for the same JNDI name against the same server seems to work fine. Would be able to enable TRACE level logging on the server side and see if you can find anything interesting?

              • 4. Re: Why is Wildfly 11 pure http invocation not working?
                andreizu

                I didn't find useful information enabling TRACE level logging. Please check them out.

                One called with the Context.PROVIDER_URL http://<IP>:8080/wildfly-services and the other with remote+http://<IP>:8080

                 

                Regards.

                • 5. Re: Why is Wildfly 11 pure http invocation not working?
                  fabio.kimura

                  I have a similar problem, but I am calling a remote EJB from inside a EJB. The communication is not pure HTTP, but instead Wildfly does a "connection upgrade", as tcpdump reveals:

                   

                  GET / HTTP/1.1

                  Sec-JbossRemoting-Key: xPAbiB2LOzLab7g==

                  Upgrade: jboss-remoting

                  Host: internal-aws-dev-ejb-http-1579827411.sa-east-1.elb.amazonaws.com:8080

                  Connection: upgrade

                   

                  HTTP/1.1 101 Switching Protocols

                  Date: Tue, 12 Dec 2017 21:20:16 GMT

                  Connection: upgrade

                  Upgrade: jboss-remoting

                  Sec-JbossRemoting-Accept: V0BjFjYVCLTBjAe4=

                   

                  I am using remote+http configuration on remote-outbound-connection:

                   

                  <remote-outbound-connection name="remote-ejb-connection" outbound-socket-binding-ref="remote-ejb" username="ejbcluster" security-realm="ejb-security-realm" protocol="remote+http">

                                      <properties>

                                          <property name="SASL_POLICY_NOANONYMOUS" value="false"/>

                                          <property name="SSL_ENABLED" value="false"/>

                                      </properties>

                                  </remote-outbound-connection>

                   

                  Any news on this thread?

                  Thanks!

                  • 6. Re: Why is Wildfly 11 pure http invocation not working?
                    vivivivi

                    Hello! I was able to fix the same error

                        ("org.jboss.ejb.client.RequestSendFailedException: EJBCLIENT000409: No more destinations are available")

                    by changing the lookup URL.

                    In my example, the deployed artifact was registered by WildFly 11 with the following JNDI name (seen in the usual server log) :

                     

                    11:17:54,705 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-2) WFLYEJB0473: JNDI bindings for session bean named 'MySessionBean' in deployment unit 'deployment "embeddedEjb.jar"' are as follows:

                        java:global/embeddedEjb/MySessionBean!my.ejbs.MySessionBeanRemote

                        [ ... many similar lines omitted ... ]

                     

                    When calling that EJB, I used the lookup URL "ejb:embeddedEjb/MySessionBean!my.ejbs.MySessionBeanRemote" (NON-WORKING!)

                    However, I got the mentioned error.

                    To perform a successful EJB call, I had to add a slash after "ejb:", like so: "ejb:/embeddedEjb/MySessionBean!my.ejbs.MySessionBeanRemote" (WORKING!)

                    In your code, it seems that "ejb:" is followed by the package name without a slash.

                     

                    To sum up, the JNDI name

                    "java:global/embeddedEjb/MySessionBean!my.ejbs.MySessionBeanRemote"

                    becomes the lookup URL

                    "ejb:/embeddedEjb/MySessionBean!my.ejbs.MySessionBeanRemote".

                     

                    Hope, that helps!

                    1 of 1 people found this helpful
                    • 7. Re: Why is Wildfly 11 pure http invocation not working?
                      andreizu

                      It was a bug in Wildfly 11.0.0.Final, fixed in the 12.0.0.Final.

                       

                      More details in:

                       

                      [WFLY-9869] Pure HTTP EJB invocation not working - JBoss Issue Tracker

                       

                      Regards.

                      • 8. Re: Why is Wildfly 11 pure http invocation not working?
                        javax4u

                        You saved me after 3 days. I was banging my head forum to forum for this error. 

                        I am using wildlfy 12.0 so answer by Andre Izu on Mar 16, 2018 2:45 PM is not correct in my case "It was a bug in Wildfly 11.0.0.Final, fixed in the 12.0.0.Final."

                         

                        so pattern goes like ejb:ear-file-name/ejb-jar-name/MySessionBean!my.ejbs.MySessionBeanRemote"

                        if your ejb is not inside ear , in other words it's put under deployment folder as ejb-jar-name.jar then pattern will be ejb:/ejb-jar-name/MySessionBean!my.ejbs.MySessionBeanRemote"

                        --------------------------------------------------------------------------------------------------------------------------------------

                        example snapshot of my situation

                        In my case