现在的位置: 首页 > 综合 > 正文

不同J2EE容器JNDI访问参数设置

2013年09月21日 ⁄ 综合 ⁄ 共 847字 ⁄ 字号 评论关闭

JBOSS:

Properties props = new Properties();
props.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.provider.url", "localhost:1099");
props.setProperty("java.naming.factory.url.pkgs","org.jboss.naming");

websphere:

Properties props = new Properties();

props.setProperty("java.naming.factory.initial","org.openejb.client.RemoteInitialContextFactory");
props.setProperty("java.naming.provider.url", "localhost:4201");

Weblogic:
Properties props = new Properties();
props.setProperty("java.naming.factory.initial",
"weblogic.jndi.WLInitialContextFactory");
props.setProperty("java.naming.provider.url", "t3://localhost:7001");

Context ctx = new InitialContext(props);
HelloWorldRemote helloworld = (HelloWorldRemote) ctx.lookup("HelloWorldBean/remote");

引用http://hi.baidu.com/winlei/blog/item/90e5a6f0f41d22c47931aaba.html

抱歉!评论已关闭.