JBOSS AS 7.1.3. Multiple EJB servers configured, WEB client calls only the first one
fabio.costantino Sep 27, 2018 12:44 PMSomeone had this problem ? Someone can help-me ?
JBoss AS 7.1.3. JBoss AS with EJB ear deployed working perfectly. Add another EJB server, configured correctly. WEB server call only the first one ...
ejb-client.properties
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
reconnect.tasks.timeout=1000
remote.connections=ejbserver01,ejbserver02
remote.connection.ejbserver01.host=192.168.1.10
remote.connection.ejbserver01.port=9447
remote.connection.ejbserver01.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.ejbserver01.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
remote.connection.ejbserver01.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=${host.auth:JBOSS-LOCAL-USER}
remote.connection.ejbserver01.username=username
remote.connection.ejbserver01.password=password
remote.connection.ejbserver01.connect.options.org.jboss.remoting3.RemotingOptions.HEARTBEAT_INTERVAL=5000
remote.connection.ejbserver02.host=192.168.1.20
remote.connection.ejbserver02.port=9447
remote.connection.ejbserver02.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.ejbserver02.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
remote.connection.ejbserver02.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=${host.auth:JBOSS-LOCAL-USER}
remote.connection.ejbserver02.username=username
remote.connection.ejbserver02.password=password
remote.connection.ejbserver02.connect.options.org.jboss.remoting3.RemotingOptions.HEARTBEAT_INTERVAL=5000
standalone.xml
<subsystem xmlns="urn:jboss:domain:remoting:1.1">
<connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
<outbound-connections>
<remote-outbound-connection name="remote-ejb-connection" outbound-socket-binding-ref="remote-ejb" username="rhmasterprime" security-realm="ejb-security-realm">
<properties>
<property name="SASL_POLICY_NOANONYMOUS" value="false"/>
<property name="SSL_ENABLED" value="false"/>
</properties>
</remote-outbound-connection>
<remote-outbound-connection name="remote-ejb-connection-02" outbound-socket-binding-ref="remote-ejb-02" username="rhmasterprime" security-realm="ejb-security-realm">
<properties>
<property name="SASL_POLICY_NOANONYMOUS" value="false"/>
<property name="SSL_ENABLED" value="false"/>
</properties>
</remote-outbound-connection>
</outbound-connections>
...
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<outbound-socket-binding name="remote-ejb">
<remote-destination host="192.168.1.10" port="9447"/>
</outbound-socket-binding>
<outbound-socket-binding name="remote-ejb-02">
<remote-destination host="192.168.1.20" port="9447"/>
</outbound-socket-binding>
</socket-binding-group>
EJB
@Stateless
@TransactionManagement(TransactionManagementType.BEAN)
@Remote(ProcessPayInterface.class)
public class ProcessPay implements ProcessPayInterface {
@Override
public Double call() {
return 1D;
}
}
CLIENT
Properties properties = new Properties();
properties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
context = new InitialContext(properties);
final String appName = "app";
final String moduleName = "module";
final String distinctName = "";
final String beanName = "ProcessPay";
final String viewClassName = ProcessPay.class.getName();
final String name = "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;
ProcessPayInterface process = (ProcessPayInterface)context.lookup(name);
Double value = process.call();
Thread.sleep(10000)
value = process.call();
// only server 192.168.1.10 was called...