"But the profile from which I am doing the lookup ends up doing the lookup in its own node."
Let me make sure I understand what you are saying:
Your application runs in profile A, your EJB is deployed in profile B.
Within profile B we have some nodes, N1, N2, ... in doing the lookup the application connects to one of the nodes, say N2, and by default when doing a lookup in N2 we see the JNDI tree associated with Node N2, which may not be where the EJB registred its name.
Is that your problem?
If it is then there are two possible approaches.
- Navigate JNDI starting at cells
- Use yhe cell/persistent partition - I recommend this
Option 1: The entire JNDI tree is visible from any node. See the JNDI diagram in the InfoCenter. You can then navigate the hierachy by spefying a path in this style
cells/<mycell>/nodes/<ejbNode>/... etc.
from anywhere.
The problem with that approach is that the application needs to understand the toplogy of the cell. If node names (or cluster names) should change the lookup string will change. That's a brittle solution.
Option 2: Instead, have the EJB register in a stable place in the JNDI tree. This is what the cell persistant partition is for. You first modify the EJB (or its DD) to specify the name as
cell/persistent/myEjb
and then use that string in your lookup.