1 Reply Latest reply on Aug 30, 2017 7:24 AM by Mirko Pir

    Remote EJB connection to Wildfly

    Mirko Pir Newbie

      I have enabled "any-address" for management, public and unsecure interfaces in my Wildfly 10.

       

      Now, from Tomcat web app I call EJBs deployed on Wildfly using remote interfaces and it works fine when both Tomcat and Wildfly are installed on the same server but when Tomcat and Wildfly are installed on different servers then EJB client on Tomcat cannot access EJB on the Wildfly and throws an error:

       

      java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:myApp, moduleName:myModule, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@642035fc

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

              at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:128)

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

              at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:255)

              at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:200)

              at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:183)

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

       

      I have turned off firewalls and there is no proxy (e.g. Apache Http Server) between Firefox and Wildfly.

       

      Question(s): is there any other setting in Wildfly that I should enable to allow remote EJB access? How can I debug this communication to see where the probem is? I don't see any errors/warnings in Wildfly logs.

        • 1. Re: Remote EJB connection to Wildfly
          Mirko Pir Newbie

          It seems that the above exception came because I was using JNDI string starting with "ejb:..." to call my remote EJB. Now I am using "java:global..." and I get this exception:

           

          javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed:

          JBOSS-LOCAL-USER: javax.security.sasl.SaslException: Failed to read server challenge [Caused by java.io.FileNotFoundException:

           

          How can I disable security when invoking remote EJBs? I have found how to remove "security-realm" attribute (ApplicationRealm) from http-remoting-connector:

           

          JBoss AS 7.1 - Disable Remote EJB Security Realm

           

          but it seems not to work with Wildfly 10.1 because I get an exception:

           

          javax.naming.NameNotFoundException: global/...MyEJBRemoteInterface...

              at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)

              at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)

              at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)

              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)

           

          Of course, when Wildfly starts I can see JNDI of my EJB listed there which should indicate that EJB is deployed but why do I then get NameNotFoundException if I remove "security-realm" attribute?

           

          I do not have any errors or warnings in my Wildfly logs during startup.