views:

200

answers:

1

Hi,

I have two profiles in my machine and in one profile I have deployed an EJB which can be looked up from a POJO in another profile. But the profile from which I am doing the lookup ends up doing the lookup in its own node. If I deploy this two application in two different machine I can perform the lookup. Some one has told me that creating a virtual machine name in WAS will help but I don't know how to use it.Can someone please help how can I resolve this issue ?

Thanks,

Kshitij Gupta

+1  A: 

"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.

  1. Navigate JNDI starting at cells
  2. 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.

djna
@djna - Thank you so much! I was looking for exactly this. This will help us with configuration (so we don't have to configure settings on every cluster node) and be able to look it up at a level higher than the node or the cluster.
Chris Aldrich
@dnja - What about the node level or cluster level? is there a persistent on each of those? I saw something like this work before at the node level "thisNode/persistend/myObj". Is thisNode soemthing that is websphere V7 only? could there be a thisNode or a thisCluster possibly pre-mapped by IBM? Just wondering if you have encountered this or not.
Chris Aldrich
@Chris so far as I knew the "persistent" namespace is completely decoupled from the toplogical node/cluster namespace. I'm not aware of other persistent spaces. Conceptually I don't know why you would want them.
djna