我正在运行 Eclipse RCP、EJB3 和 Jboss EAP 6.3
工作- 当我使用远程 JBoss 配置和 EJB 查找从 Eclipse 启动选项运行我的 RCP 应用程序时。
要求- 当我导出 RCP 产品并启动时,它无法查找远程 EJB bean。在 eclipse IDE 中工作的相同代码。
EJB 查找 URL 格式:
ejb:/remoteApp//Bean!org.jboss.as.stateless.RemoteCalculator
收到错误消息的代码:
Properties properties = new Properties();
properties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
properties.put("jboss.naming.client.ejb.context", true);
properties.put(Context.PROVIDER_URL,"remote://10.10.10.10:4447");
properties.put(Context.SECURITY_PRINCIPAL, "userAdmin");
properties.put(Context.SECURITY_CREDENTIALS, "userAdmin#1");
Context context = new InitialContext(properties);
Object returnValue = context.lookup(jndi); // throw exception at this line
注意:我已经正确配置了所有其他配置,因为它在本地环境中工作(即带有所有数据源和 JBoss 用户/密码设置的 Eclipse)。需要知道如何从导出的 RCP 产品中查找 EJB bean。