How to configure XNIO/Remoting options for an EJB client in EAP 7.1

Solution Unverified - Updated

Environment

Red Hat JBoss Enterprise Application Platform (EAP)

Issue

  • How to configure XNIO/Remoting options for an EJB client in EAP 7.1 ?

Resolution

Using WildflyInitialContext environment properties

Prefixed with jboss.naming.client.connect.options for example:

   Properties props = new Properties();
   props.put(Context.INITIAL_CONTEXT_FACTORY,  "org.wildfly.naming.client.WildFlyInitialContextFactory");
   props.put(Context.PROVIDER_URL, String.format("%s://%s:%d", "remote+http", host, port));
   props.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS", "JBOSS-LOCAL-USER");
   if(username != null && password != null) {
      props.put(Context.SECURITY_PRINCIPAL, username);
      props.put(Context.SECURITY_CREDENTIALS, password);
    }
   Context ctx = new InitialContext(props);

Using wildfly-config.xml

Using Programmatic EJB client context builder

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.