Accessing a Cluster AS7 Servers from a POJO Client
foutjo Apr 30, 2013 10:04 AMI currently have a cluster setup using a Domain controller to manage the cluster.
My problem is I can't get my java client to connect to one of my clustered servers.
Here is my current setup:
Machine A - domain controller
Machine B - host controller
Server B
Machine C - host controller
Server C
I have the following SLSB deployed on all servers:
@Stateless
@Remote(BGController_RemoteInf.class)
@Clustered
public class BGController implements BGController_RemoteInf
{
.
.
My client to access the clustered servers is NOT a JSP but rather a simple java program(POJO) running in its own JVM.
Here is a snippit from my client code:
try
{
final Hashtable<String,String> jndiProperties = new Hashtable<String, String>();
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
final Context context = new InitialContext(jndiProperties);
final String appName = "";
final String moduleName = "LIDP_BGProcess";
final String distinctName = "";
final String beanName = "BGController";
final String viewClassName = BGController_RemoteInf.class.getName();
String bean = "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;
BGController_RemoteInf testBean = (BGController_RemoteInf) context.lookup(bean);
testBean.process(load);
}
catch (Exception e)
{
LOGGER.error("Exception /BGController");
e.printStackTrace();
}
Finally here is how jboss.ejb.client.properties is defined:
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=10.90.100.21
remote.connection.default.port=4447
remote.connection.default.username=xxxxx
remote.connection.default.password=xxxx
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.two.host=10.90.100.2
remote.connection.two.port=4447
remote.connection.two.username=xxxxx
remote.connection.two.password=xxxx
remote.connection.two.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
When executing the client I get the following stacktrace:
java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:LIDP_BGProcess, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@56f4defc
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:693)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:177)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:161)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:124)
at $Proxy0.process(Unknown Source)
at com.lidp.main.StartBGProcess.<init>(StartBGProcess.java:43)
at com.lidp.main.StartBGProcess.main(StartBGProcess.java:22)
My thought is that I don't have the jboss.ejb.client.properties setup correctly.
Any thoughts on what I might be doing wrong would be greatly appreciated.
Thanks.