Just putting raw steps to guide through the configuration part –

First copy “jboss-ejb-client.properties” to the class path which defines the jboss cluster topolgy. Or manually load the properties into the EJB context on the client side.

 

For manually load , use code below –

final Properties clientProps = new Properties();

 try {
 InputStream inputStream = new FileInputStream(new File(System.getProperty("PropertiesDir"), 
 EJB_CLIENT_PROPERTY_FILE_NAME));
 clientProps.load(inputStream);
 } catch (IOException e) {
 throw new EventSenderException("Could not find EJB client configuration properties at " + EJB_CLIENT_PROPERTY_FILE_NAME
 + " in directory ");
 }
 final EJBClientConfiguration clientConfiguration = new PropertiesBasedEJBClientConfiguration(clientProps);
 final ConfigBasedEJBClientContextSelector selector = new ConfigBasedEJBClientContextSelector(clientConfiguration);
 EJBClientContext.setSelector(selector);
 StatelessEJBLocator<RemoteService> statelessEJBLocator = new StatelessEJBLocator<RemoteService>(RemoteService.class,
 getPropertyVal(REMOTE_HDS_APPLICATION_NAME), getPropertyVal(REMOTE_HDS_MODULE_NAME),
 getPropertyVal(REMOTE_HDS_BEAN_NAME), "");
 remoteService = EJBClient.createProxy(statelessEJBLocator);


 

And sample properties file should look like this –

### Jboss EJB Client properties file to define Jboss Host and port properties
### 
###
remote.connections=default
remote.connection.default.host=10.51.5.99
remote.connection.default.port = 4447
remote.connection.default.username=hds
remote.connection.default.password=hdshds
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

# Declare the cluster(s)
remote.clusters=ejb
remote.cluster.ejb.username=hds
remote.cluster.ejb.password=hdshds

# Connection configuration(s) for the "ejb" cluster (these are just random examples. You might have to add username and password
# or callbackhandler depending on the security configuration(s) of these cluster node servers.
remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.cluster.ejb.connect.options.org.xnio.Options.SSL_ENABLED=false
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

# Remote EJB client properties
#
# Application name of remote hds. It is the name of the .ear deployed with Remote EJB in Jboss. 
# For e.g. if name of deployed ear is 'hds.ear', then value should be 'hds'.
remote.hds.application.name=hds
# Module name of remote hds. It is the module name or jar name in which Remote service implementation is deployed. 
# For e.g. - if jar name is 'service-service.jar', then this value should be 'service-service'.
remote.hds.module.name=service-service-1.0.0-SNAPSHOT
# It is the simple name of implementation of remote interface RemoteService. 
# For e.g. - If 'RemoteServiceImpl' is providing implementation then value of this should be 'RemoteServiceImpl'.
remote.hds.bean.name=RemoteServiceImpl


Should work smoothly.. steps are quite raw . But i hope it will help someone Or may be helpful me later 😉

Advertisements