JNDI lookup when two WAS profiles are using the same machine

I have two profiles on my machine and in one profile I have deployed an EJB which can be found with a POJO in another profile. But the profile I'm searching from ends up searching in its own node. If I deploy this application on two different machines, I can search. Someone told me that creating a VM name in WAS would help, but I don't know how to use it. Anyone please help how can I solve this problem?

Thank,

Kshitiy Gupta

+2


source to share


2 answers


"But the profile I'm searching from ends up searching in its own node."

Let me make sure I understand what you are saying:

Your application is running in profile A, your EJB is deployed in profile B.

In profile B we have multiple nodes, N1, N2, ... when searching connected to one of the nodes, for example N2, and by default, when doing a search in N2, we see a JNDI tree associated with Node N2, which may not be there where the EJB registered its name.

It's your problem?

If so, there are two possible approaches.

  • Go to JNDI starting with cells
  • Use cell / persistent section - recommend this


Option 1: The entire JNDI tree is visible from any node. See the JNDI diagram in the InfoCenter. Then you can navigate the hierarchy by giving the path in this style

cells/<mycell>/nodes/<ejbNode>/... etc.  

      

from anywhere.

The problem with this approach is that the application needs to understand the cell's tolerance. If the Node names (or cluster names) need to change, the search string will change. This is a fragile decision.

Option 2: Register the EJB register in a persistent location in the JNDI tree instead. This is what a permanent cell section is for. First you change the EJB (or its DD) to specify the name as

cell/persistent/myEjb

      

and then use that string in your search.

+4


source


I ran into this issue while installing on a client machine these days. I spent 4 days fighting over why this is not a job. I don't know how you discovered this so quickly, but the solution is very simple:



If you have 2 WAS on the same hostname, the WAS client thinks the server is the same, so it will avoid searching through CORBA, we decided to link the 2 WAS with two different hostnames and IPs. and that does the trick.

0


source







All Articles