Could not create a connection for cluster node ClusterNode in JBoss EAP 7 / 6
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.x
- 6.x
Issue
- We are able to invoke a single node, but when we configure our ejb-client to invoke a cluster, it fails to connect to the cluster nodes with this message:
INFO: Could not create a connection for cluster node ClusterNode{clusterName='ejb', nodeName='node1:server', clientMappings=[ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='192.168.1.100', destinationPort=12345}], resolvedDestination=[Destination address=192.168.1.100, destination port=12345]} in cluster ejb
java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:92)
Properties prop = new Properties();
prop.put("remote.clusters", "ejb");
prop.put("remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", false);
prop.put("remote.cluster.ejb.connect.options.org.xnio.Options.SSL_ENABLED", false);
prop.put("endpoint.name", CLIENT_ENDPOINT);
prop.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", SSL_ENABLED);
prop.put("remote.connections", "default");
prop.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", SASL_POLICY_NOANONYMOUS);
prop.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
prop.put("remote.connection.default.host", REMOTE_HOST);
prop.put("remote.connection.default.port", REMOTE_PORT);
prop.put("remote.connection.default.username", USERNAME);
prop.put("remote.connection.default.password", PASSWORD);
return new PropertiesBasedEJBClientConfiguration(prop);
Resolution
In JBoss EAP 7.0 / 6.4 , the ejb-client needs to also specify the cluster username and password such as:
p.put("remote.cluster.ejb.username", "user");
p.put("remote.cluster.ejb.password", "password");
In JBoss EAP 7.1+ it included a feature that simplifies the configuration and would not need the cluster configuration specified.
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.