mashiguang

          小馬快跑

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            20 隨筆 :: 0 文章 :: 60 評(píng)論 :: 0 Trackbacks


          調(diào)用ejb時(shí),如果客戶端和ejb不在同一個(gè)jvm,就要設(shè)置InitialContext,不同的應(yīng)用服務(wù)器InitialContext寫法也不同.
          Context.INITIAL_CONTEXT_FACTORY:指定到目錄服務(wù)的連接工廠
          Context.PROVIDER_URL:目錄服務(wù)提供者URL

          //jboss:
          Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"
          Context.URL_PKG_PREFIXES, "org.jboss.naming"
          Context.PROVIDER_URL, "localhost:1099"

          //weblogic:
          Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"
          Context.PROVIDER_URL, "t3://localhost:7001"

          //apusic(金蝶):
          Context.INITIAL_CONTEXT_FACTORY, "com.apusic.jndi.InitialContextFactory"
          Context.PROVIDER_URL, "rmi://localhost:6888"

          //WebSphere:
          Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"
          Context.PROVIDER_URL, "iiop://localhost:900"


          //J2EE  SDK(J2EE  RI):
          Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory"
          Context.PROVIDER_URL, "iiop://127.0.0.1:1050"

          //SilverStream:
          Context.INITIAL_CONTEXT_FACTORY, "com.sssw.rt.jndi.AgInitCtxFactory"
          Context.PROVIDER_URL, "sssw://localhost:80"

          //OC4J:
          Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory"
          Context.PROVIDER_URL, "ormi://127.0.0.1/"

          //WAS5:
          Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"
          Context.PROVIDER_URL, "iiop://localhost:2809"

           

          常用JNDI服務(wù)提供者連接工廠:
          Filesystem:  Com.sun.jndi.fscontext.FSContextFactory或者com.sun.jndi.fscontext.RefFSContextFactory
          LDAPv3:    Com.sun.jndi.ldap.LdapCtxFactory
          NDS:     com.novell.naming.service.nds.NdsInitialContextFactory
          NIS:     com.sun.jndi.nis.NISCtxFactory
          RMI registry: com.sun.jndi.rmi.registry.RegistryContextFactory
          IBM LDAP服務(wù)提供者:   com.ibm.jndi.LDAPCtxFactory
          BEA 名字服務(wù)提供者:   weblogic.jndi.WLInitialContextFactory
          JBOSS名字服務(wù)提供者:  org.jnp.interfaces.NamingContextFactory

          posted on 2008-07-14 16:35 mashiguang 閱讀(14802) 評(píng)論(2)  編輯  收藏 所屬分類: java web開發(fā)

          評(píng)論

          # 補(bǔ)充Borland Enterprise Server JNDI用法[未登錄] 2008-12-20 23:08 James
          Properties props=new Properties();
          props.put(Context.PROVIDER_URL,"corbaloc::173.6.7.143:14500/NameService");
          props.put("java.naming.factory.initial","com.inprise.j2ee.jndi.CtxFactory");
          Context context = new InitialContext(props);
          // Context context = new InitialContext();

          Object ref = context.lookup("com/borland/examples/j2ee/hello/Hello");
          HelloWorldHome home = (HelloWorldHome) javax.rmi.PortableRemoteObject.narrow(ref, HelloWorldHome.class);
          hello = home.create();
            回復(fù)  更多評(píng)論
            

          # re: jndi調(diào)用時(shí),各種應(yīng)用服務(wù)器InitialContext的寫法 2010-07-12 17:01 淘寶網(wǎng)女裝皇冠店
          jndi調(diào)用時(shí),各種應(yīng)用服務(wù)器InitialContext的寫法   回復(fù)  更多評(píng)論
            

          主站蜘蛛池模板: 金秀| 金山区| 绥德县| 钟祥市| 乐都县| 威信县| 山阴县| 镇坪县| 洛南县| 石棉县| 桐乡市| 施甸县| 黄梅县| 绥化市| 沅江市| 北安市| 广南县| 岢岚县| 保靖县| 博客| 新安县| 吉木萨尔县| 化隆| 嵊州市| 郑州市| 绥宁县| 南充市| 镇沅| 大埔区| 体育| 东城区| 昌平区| 固原市| 游戏| 水富县| 张家界市| 洛扎县| 吉水县| 峨边| 澄迈县| 侯马市|