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

来源:互联网 发布:母鸡自己能下蛋吗 知乎 编辑:程序博客网 时间:2024/04/29 03:29
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
原创粉丝点击