I am trying to invoke a stateless EJB, deployed on a remote server. I can invoke the bean from my local JBoss environment but when I change the remote.connection.default.host
to the remote machine's host, my client code does not work.
This is my jboss-ejb-client.properties
:
endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=SERVERIP/HOSTNAME
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.username=username
remote.connection.default.password=Password
And my client code looks like this:
Properties properties = new Properties();
properties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
String jndi = "jndi_name";
Context context = new InitialContext(properties);
obj = context.lookup(jndi);
Please help.
Thanks all. Jack.