Posted on 2010-01-20 21:25
landor 閱讀(1069)
評論(0) 編輯 收藏 所屬分類:
weblogic
在非集群中,也就是單server的時候采用的是如下方式:
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
......
但是在集群環境中,如何配置?
參照weblogic文檔
http://download.oracle.com/docs/cd/E15051_01/wls/docs103/jndi/jndi.html#wp467605
知道可以這么設置
# The following example specifies a list of WebLogic Servers using the same port:
ht.put(Context.PROVIDER_URL,"t3://acme1,acme2,acme3:7001");
All the WebLogic Servers listen on the port specified at the end of the URL.
# The following example specifies a list of WebLogic Servers using the different ports:
ht.put(Context.PROVIDER_URL,"t3://node1:7001,node2:7002,node3:7003");
端口相同的話,可以省略端口,放到最后面寫,端口不同就都寫上
這樣weblogic會自動尋找相應的jndi