I am using JSF and EJB as two separate project in my application. Below i described code used to JNDI lookup
protected final Object lookup(Class className) throws NamingException {
Properties properties = new Properties();
properties.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
properties.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
properties.put("java.naming.provider.url",ProjectConstants.PORT_NUMBER);
initialContext = new InitialContext(properties);
return initialContext.lookup(ProjectConstants.DEPLOYMENT_NAME+"/"+className.getSimpleName().substring(0, className.getSimpleName().lastIndexOf("Remote")) + "/remote-" + className.getName());
}
Is there any special configuration require in jboss for port, i am used for lookup ?
By default the JNDI port is
1099. If you want another port start jBoss with-Djboss.service.binding.set=ports-01. This will add 100 to every port. 1099 -> 1199 etc.