我在我的應用程序中使用JSF和EJB作爲兩個單獨的項目。下面我描述了用於JNDI查找的代碼配置JNDI查找端口jboss + EJB
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());
}
是否有任何特殊配置需要在jboss中用於端口,我用於查找?
是的你是對的 – chetan 2011-06-01 17:14:55