• Post Reply Bookmark Topic Watch Topic
  • New Topic

Distributed EJB lookup problem

 
Clarence Dyho
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

My web app works if the sessions beans being called are deployed in the same websphere container/server instance. I'd like to know how I should rewrite/configure the JNDI lookup in my codes to use the EJBs if they are deployed in another webSphere (or other app server) instance separately from my webapp within the same network. Apparently, the java:comp/env/.. lookup string does not work anymore. Is this something that I could setup in my EJB deployment descriptors or do I have to do some tweaking in the app server and leave my codes as is? Any examples would be welcome. Your response is greatly appreciated.

Thank you.
Clarence
 
Adrian Marti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are the servers being clustered? If not then both are creating their own JNDI trees *i think*. Somethign to look into before experts chime in.

Adrian
 
Clarence Dyho
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your response Adrian.

No. The servers are not clustered. My app just need to call the EJBs deployed in another Websphere server across the network. I'm not sure how to call them or set up the deployment descriptors for my app to find the EJBs.
 
Brian Tinnel
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If they are not clustered, then you have to access the other app server like any other client would by creating an InitialContext that is configured correctly. Something like:

 
Clarence Dyho
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Brian.

I have gotten this far too. My problem now is with the JNDI names.
Whereas I was using "java:comp/env/someName" for the lookup before, I can't use it now.
I tried using the full JNDI binding name of the remote EJB but I kept getting the following error:

Context: localhost/nodes/localhost/servers/server1, name: ejb/MsmServiceBnMgr: First component in name MsmServiceBnMgr not found.


The app servers are not clustered. We are now looking into putting both app servers into 1 machine but running on separate JVMs. I think I would still have the same problem. Any further information is greatly appreciated.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!