• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Distributed EJB lookup problem

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic