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
不同J2EE容器JNDI访问参数设置
最新推荐文章于 2022-02-25 19:38:17 发布