不同profile之间EJB调用问题javax.naming.NameNotFoundException

本文探讨了在集群环境中,两个节点上拥有相同名称的应用服务器导致EJB查找失败的问题。详细介绍了问题的症状、原因及解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Technote (troubleshooting)


Problem(Abstract)

In a clustered environment, in which 2 nodes have Application Servers with the same name, an attempt to lookup an EJB in the name space during an EJB invocation finds the wrong server.

Symptom

The result is that an EJB invocation fails with the following exception:

Root exception is org.omg.CosNaming.NamingContextPackage.NotFound IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
 
This exception can be seen in the    SystemOut.log file.  

Despite running the    dumpNameSpace tool (run in the cell level), and finding that the name/object is in the name space, the look up does not work. 

Cause

This problem is caused by the lack of uniqueness of the host name and server name pair in a clustered environment. That is, 2 servers on the same host (federated in a Network Deployment) but on different nodes, and with the sameServer_ID and Server_UUID between the node-agents and thus are not unique according to the ORB. Server IDs used by the ORB are constructed from the host name and the server name.

For example, 2 nodes in a cluster are defined as follows:

  • Node 1 has an Application Server named server1 with an EJB deployed on that server.

  • Node 2 has an Application Server named server1. It has a Web application that is attempting to invoke the EJB onserver1 onNode 1.

These 2 nodes have the same server defined,    server1. The ORB on    Node 1 successfully finds the EJB since it is on the same node. The Web application on    Node 2 gets the error message and    NameNotFoundException.   

The reason that the problem occurs is that when the ORB code on    Node 2 looks up    server1 to find this EJB, it finds the instance on    Node 2 (the local instance) rather than the    server1 on    Node 1, which is where the EJB is initiated. 

Resolving the problem

The solution for this problem is to have different server names for the servers for 2 different nodes.


OR

Make reference per suggestion in the link below:

http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/topic/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rtrb_namingprobs.html

--> under "Two servers with the same name running on the same host are being used to interoperate" topic.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值