如何编写WebSphere 8.5的JNDI.创建EJB 2.1项目时,Eclipse Luna



我看到了jndi.properties文件的示例jboss server

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

这是一个代码段

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);

最新更新