java - eclipse Luna创建EJB 2.1项目时如何为Websphere 8.5编写jndi.properties
问题描述
我看到了 JBoss 服务器的 jndi.properties 文件示例
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost
我应该在此处进行哪些更改以使其适用于 Websphere 8.5?
我正在使用本教程作为参考
https://www.tutorialspoint.com/ejb/ejb_create_application.htm
解决方案
这是一段代码,其中包含在我的 Websphere 8.5 环境中工作的属性:
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
Properties p = new Properties();
p.put(Context.PROVIDER_URL, "iiop://localhost:2809");
p.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
p.put("com.ibm.websphere.naming.jndicache.cacheobject", "cleared");
Context context = new InitialContext(p);
推荐阅读
- wpf - WPF 打印到 Epson TM-H6000 Slip
- pandas - 获取分组数据的索引
- prolog - 为和运算符谓词给出的结果(Prolog)
- bots - 不和谐 | DiscordAPIError:无法向该用户发送消息
- python - 如何从 Pandas 数据框中的特定列写入多个 Excel 表?
- angular - 完成服务调用后加载视图组件(表),该服务调用推送包含表信息的数组
- reactjs - react jsconfig.json 忽略路径
- swift - 适合 SwiftUI 中自定义视图的内容模式
- blazor - 如何将焦点设置到 Blazor 中的文本框
- odoo - 计算总和 Odoo