1 Reply Latest reply on Apr 9, 2018 12:50 AM by Daniel Fb

    [SOLVED] Wildfly 12 - EJB invocations from remote servers under domain controller

    Daniel Fb Newbie

      Hello,

       

      I am following the instructions from this link: Getting started with EJBs and Elytron Part 2: EJB invocations from remote servers

      Trying to replicate those configurations under domain controller but without success.

       

      I have two server groups, one is client of other. But the servers of server group "B" still unable to lookup the remote EJB from servers of server group "A"

      I tried to configure the servers with jboss-cli.sh from domain controller. Applying the configurations at the corresponding profiles.

       

      Ex:

      From Domain Controller's jboss-cli.sh:

      1. /profile=my-custom-profile-full-ha/subsystem=elytron/authentication-configuration=ejb-auth-config:add(authentication-name=ejb, credential-reference={clear-text="ejbejb"}) 

       

      and so on...

      The socket-binding-group is defined at domain.xml as well.

       

      But my client server still getting errors when lookup the remote EJB.

      Is there other configuration for servers running under domain controller to get remote invocations work?

       

      The error:

      javax.ejb.NoSuchEJBException: EJBCLIENT000079: Unable to discover destination for request for EJB StatelessEJBLocator for "/portal/SampleEJB", view is interface my.company.ejb.interfaces.SampleEJBRemote, affinity is None

       

      Lookup:

      Properties properties = new Properties();

      properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");

      InitialContext context = new InitialContext(properties);

      SampleEJBRemote remote = (SampleEJBRemote) context.lookup("ejb:/portal/SampleEJB!my.company.ejb.interfaces.SampleEJBRemote");

       

      Thanks!

        • 1. Re: Wildfly 12 - EJB invocations from remote servers under domain controller
          Daniel Fb Newbie

          solved.

           

          I need to configure elytron subsystem with these configurations:

          /subsystem=elytron/authentication-configuration=ejb-outbound-configuration:add(security-domain=ApplicationDomain,sasl-mechanism-selector="PLAIN")

          /subsystem=elytron/sasl-authentication-factory=application-sasl-authentication:write-attribute(name=mechanism-configurations,value=[{mechanism-name=PLAIN},{mechanism-name=JBOSS-LOCAL-USER,realm-mapper=local},{mechanism-name=DIGEST-MD5,mechanism-realm-configurations=[{realm-name=ApplicationRealm}]}])

           

          looks like the PLAIN mechanism is what the missing.

           

          and set a system property (wildfly.config.url) pointing to wildfly-config.xml file:

          <configuration>

               <authentication-client xmlns="urn:elytron:1.0">

                  <authentication-rules>

                      <rule use-configuration="default"/>

                  </authentication-rules>

                  <authentication-configurations>

                      <configuration name="default">

                          <set-user-name name="ejbuser"/>

                          <credentials>

                              <clear-password password="superPwd1!"/>

                          </credentials>

                          <sasl-mechanism-selector selector="PLAIN"/>

                          <providers>

                              <use-service-loader />

                          </providers>

                      </configuration>

                  </authentication-configurations>

              </authentication-client>

          </configuration>