mashiguang

          小馬快跑

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            20 隨筆 :: 0 文章 :: 60 評論 :: 0 Trackbacks


          調用ejb時,如果客戶端和ejb不在同一個jvm,就要設置InitialContext,不同的應用服務器InitialContext寫法也不同.
          Context.INITIAL_CONTEXT_FACTORY:指定到目錄服務的連接工廠
          Context.PROVIDER_URL:目錄服務提供者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服務提供者連接工廠:
          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服務提供者:   com.ibm.jndi.LDAPCtxFactory
          BEA 名字服務提供者:   weblogic.jndi.WLInitialContextFactory
          JBOSS名字服務提供者:  org.jnp.interfaces.NamingContextFactory

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

          評論

          # 補充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();
            回復  更多評論
            

          # re: jndi調用時,各種應用服務器InitialContext的寫法 2010-07-12 17:01 淘寶網女裝皇冠店
          jndi調用時,各種應用服務器InitialContext的寫法   回復  更多評論
            

          主站蜘蛛池模板: 马边| 德州市| 兰州市| 凤城市| 南陵县| 新民市| 昌乐县| 宁强县| 徐汇区| 浠水县| 永靖县| 温宿县| 安龙县| 周至县| 康马县| 神木县| 北海市| 三门峡市| 台中市| 兴海县| 衡东县| 吉水县| 平山县| 石屏县| 铜鼓县| 怀来县| 汉川市| 鄂尔多斯市| 新邵县| 高雄县| 莱芜市| 泸西县| 怀安县| 漳州市| 尖扎县| 历史| 兴化市| 宜都市| 岳阳市| 会泽县| 元谋县|