mashiguang

          小馬快跑

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


          調(diào)用ejb時(shí),如果客戶端和ejb不在同一個(gè)jvm,就要設(shè)置InitialContext,不同的應(yīng)用服務(wù)器InitialContext寫(xiě)法也不同.
          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 閱讀(14813) 評(píng)論(2)  編輯  收藏 所屬分類: java web開(kāi)發(fā)

          評(píng)論

          # 補(bǔ)充Borland Enterprise Server JNDI用法[未登錄](méi) 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的寫(xiě)法 2010-07-12 17:01 淘寶網(wǎng)女裝皇冠店
          jndi調(diào)用時(shí),各種應(yīng)用服務(wù)器InitialContext的寫(xiě)法   回復(fù)  更多評(píng)論
            

          主站蜘蛛池模板: 乌拉特中旗| 偏关县| 台中市| 甘南县| 库尔勒市| 泽库县| 辉南县| 浦城县| 岳普湖县| 沿河| 泰顺县| 朝阳县| 宝应县| 扶余县| 视频| 灵台县| 渝北区| 大丰市| 宁国市| 河间市| 金平| 青川县| 大洼县| 会东县| 木兰县| 二连浩特市| 宜川县| 松溪县| 蓝田县| 临海市| 汶川县| 耿马| 青冈县| 无为县| 涟源市| 西昌市| 彰化市| 文安县| 土默特右旗| 社旗县| 衡南县|