Ordinary hut

人间一福地,胜似天仙宫
posts - 61, comments - 50, trackbacks - 0, articles - 1

weblogic集群中获取jndi的方式

Posted on 2010-01-20 21:25 landor 阅读(1040) 评论(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


只有注册用户登录后才能发表评论。


网站导航: